当前位置: 代码迷 >> Oracle管理 >> 把查询的结果作为数据参数输出,创建过程后提示带警告解决办法
  详细解决方案

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

热度:73   发布时间:2016-04-24 05:26:46.0
把查询的结果作为数据参数输出,创建过程后提示带警告
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;
  相关解决方案