首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

把查询的结果作为数据参数输出,创建过程后提示带警告解决办法

2012-04-07 
把查询的结果作为数据参数输出,创建过程后提示带警告create orreplace procedure serch_sum (sumb11 out n

把查询的结果作为数据参数输出,创建过程后提示带警告
create or replace procedure serch_sum (sumb11 out number,ddate String)
is
begin
 sumb11 := select sum(combank) from bank where com=101 and ddate between to_date(ddate+' 00:00:00','yyyy-mm-dd') and to_date(ddate+' 23:00:00','yyyy-mm-dd');
end;

提示编译完成但带有警告,我需要把查询出来的值作为输出参数传出去

[解决办法]

探讨
sumb11 := select sum(combank) from bank where com=101 and ddate between to_date

[解决办法]
SQL code
create or replace procedure serch_sum(sumb11 out number, ddate String) isbegin  select sum(combank)    into sumb11    from bank   where com = 101     and ddate between to_date(ddate + ' 00:00:00', 'yyyy-mm-dd') and         to_date(ddate + ' 23:00:00', 'yyyy-mm-dd');end; 

热点排行