open qyrow for 'select bj,bsh,cch,csh,hy from kf_yjdj
where qkmch=:1 and jh=:2 and to_char(rkrq,''yyyy-mm-dd'')=:3'
using qkmch1,jh1,rkrq1 ;
where qkmch=:1 and jh=:2 and to_char(rkrq,''yyyy-mm-dd'')=:3'
using qkmch1,jh1,rkrq1 ;
2 dbms_output.put_line('select bj,bsh,cch,csh,hy from kf_yjdj where qkmch=:1 and jh=:2 and to_char(rkrq,''yyyy-mm-dd'')=:3 ');
3 end;
4 /select bj,bsh,cch,csh,hy from kf_yjdj where qkmch=:1 and jh=:2 and to_char(rkrq,'yyyy-mm-dd')=:3 PL/SQL procedure successfully completed楼主检查一下语句执行的时候是不是有什么地方类型不匹配
where qkmch=:1 and jh=:2 and to_char(rkrq,'''yyyy-mm-dd''')=:3'
using qkmch1,jh1,rkrq1 ;
更正一下:
open qyrow for 'select bj,bsh,cch,csh,hy from kf_yjdj
where qkmch=:1 and jh=:2 and to_char(rkrq,''yyyy-mm-dd'')=:3'
using qkmch1,jh1,rkrq1 ;
type row_sql is ref cursor;
row row_sql;
tab kf_yjdj%rowtype;
psbj kf_yjdj.bj%type;
begin
open row for 'select bj from kf_yjdj ';
loop
fetch row into tab;
exit when row%notfound;
psbj:=tab.bj;
end loop;
close row;
psbj1:=psbj;
end;
为什么出这个错啊,,
在这行提示 fetch row into tab; 真晕,,,,,