批量删除数据

–每500条数据提交一次
DECLARE CNT NUMBER(10):=0;
I NUMBER(10);
BEGIN
SELECT COUNT(*) INTO CNT FROM DBBC011 where qxlxzs is null;
FOR I IN 1..TRUNC(CNT/500)+1
LOOP
DELETE FROM DBBC011 where qxlxzs is null AND ROWNUM<=500;
COMMIT;
END LOOP;
END;

posted @ 2020-04-09 10:51  南国之恋  阅读(169)  评论(0编辑  收藏  举报