declare
iCount int:=0;
sPath nvarchar2(200);
tdzsh nvarchar2(50);
begin
for x in (select c.imgpath from imgfolderpath c) loop
NULL;
--dbms_output.put_line(x.imgpath);
icount := icount+1;
spath:=x.imgpath;
end loop;
--iCount:=SQL%rowcount;
DBMS_output.put_line(‘影响了‘||iCount||‘行‘);
DBMS_output.put_line(spath);
for x in (select d.djkid,d.bz1,d.qlr,d.tdzl from djk_tab d) loop
icount :=0;
tdzsh:=x.bz1;
--for y in (select c.imgpath from imgfolderpath c where c.imgzsbh=tdzsh) loop
-- spath:= y.imgpath;
-- icount:=icount+1;
--end loop;
select count(c.imgzsbh) into icount from imgfolderpath c where c.imgzsbh=tdzsh;
end loop;
icount:=SQL%rowcount;
if icount>0 then
DBMS_output.put_line(1);
else
DBMS_output.put_line(0);
end if;
end;
原文:http://www.cnblogs.com/yansc/p/4894506.html