首页 > 数据库技术 > 详细

oracle 游标示例

时间:2015-10-20 14:01:10      阅读:259      评论:0      收藏:0      [点我收藏+]

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;

oracle 游标示例

原文:http://www.cnblogs.com/yansc/p/4894506.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!