oracle 游标使用

如:
declare
cursor mycur is
select (y.incept_class||'-'||to_char(y.incept_no)) ,y.iid
  from ut_gw_urge t, ut_gw_archive_incept y
 where t.iid = y.iid
   for update;
/*type myrecord is record*/
newnum VARCHAR2(36);/*new value*/
yiid NUMBER;/*condition*/

begin
open mycur;
loop
fetch mycur into newnum,yiid;
exit when mycur%notfound;
update ut_gw_urge set ut_gw_urge.num =newnum
where ut_gw_urge.iid = yiid;
/*fetch mycur into yiid;*/
end loop;
close mycur;
end;
posted @ 2008-10-27 16:34  曲达子  阅读(216)  评论(0编辑  收藏  举报