博客园

Oracle 游标实例

declare
 
linenumA varchar2(30);
skdwA varchar2(30);
 
cursor getlines is
select linenum,skdw from zw_skdwqr 
where linenum in('2009121669117392') 
and qrbz=1 and lx=1 ;
 
begin
 
if getlines%isopen = false then
 
open getlines;
 
end if;
 
fetch getlines into linenumA,skdwA;
 
while getlines%found 
loop
delete from zw_skdwqr where linenum=linenumA and lx=1
and skdw=skdwA and qrbz=2;
commit;
fetch getlines into linenumA,skdwA;
end loop;
close getlines;
end;

 

posted @ 2012-11-08 20:53  一心一意  阅读(501)  评论(0编辑  收藏  举报

Powered by:
一心一意
Copyright & JGuang