3,497
社区成员
发帖
与我相关
我的任务
分享
set serveroutput on
declared
cursor cur is
select id,status
from 表名
where rownum<=100
and type='给定值'
and status='1'
for update;
begin
for rec in cur loop
update 表名 set status='2' where current of cur;
dbms_output.put_line('更新的id为:['id']');
end loop;
end;
/
