每500条记录commit;
sqlplus -s $USER/$PWD@DBNAME <<!!
declare
lcnt number:=0
begin
select count(1) into lcnt from tbsutdent where status='1';
for i in 0..ceil(lcnt/500)+1 loop
update tbstudent set status='0' where status='1' and rownum<=500;
commit;
end loop;
!!
本文介绍了一种使用PL/SQL过程批量更新数据库记录并每500条记录进行一次提交的方法,以提高数据处理效率。
4689

被折叠的 条评论
为什么被折叠?



