declare
i integer;
begin
i := 0;
for rr in (select rowid from salebilltable where usercode is null) loop
i := i + 1;
update salebilltable
set usercode = substr(userid, 1, 6)
where rowid = rr.rowid;
commit;
if (mod(i, 10000) = 0) then
dbms_output.put_line('update ' || i || 'rows');
end if;
end loop;
dbms_output.put_line('update ' || i || ' rows');
dbms_output.put_line('Done Successfully!');
exception
when others then
rollback;
dbms_output.put_line(sqlcode);
end;
存储过程更新表
最新推荐文章于 2024-04-08 19:16:39 发布