create or replace procedure Proc_Get_MLTInputData(startdate in date,enddate in date)
as
begin
select Unitsinfoname,Productsname,CreateDate,nvl(CheckValues,Readvales) as value from RawMeteringChamber
where CreateDate>=startdate and CreateDate<=enddate;
end
http://blog.csdn.net/edcvf3/article/details/7844575 参考一下
你这个存储过程要做什么用的?
返回数据集?还是执行语句?还是打印出来?
存储过程没有直接在里面执行查询SQL的语法。
--------
如果你的结果集是一条记录,那么你可以定义变量,将查询的结果INTO 到变量里
如果是多条,你可以定义一个游标,使用游标返回结果集.
如果你什么都不想做,纯粹玩PL/SQL,那么你可以使用EXECUTE IMMEDIATE 'SELECT ...';