标签:HERE test cursor count() 数据 into index commit etc
偶遇需求,大表中需要删除部分数据。分批删除。
declare
TYPE type_table_rowid IS TABLE OF ROWID INDEX BY BINARY_INTEGER;
table_rowid type_table_rowid;
CURSOR cur_tmp IS
select rowid from test t where id=‘111111‘ or uin=‘222222‘; --------需要删除的数据的rowid获取
BEGIN
OPEN cur_tmp;
LOOP
FETCH cur_tmp BULK COLLECT
INTO table_rowid LIMIT 5000;
FORALL i IN 1 .. table_rowid.COUNT()
delete from test where ROWID = table_rowid(i);
COMMIT;
EXIT WHEN cur_tmp%NOTFOUND;
END LOOP;
COMMIT;
CLOSE cur_tmp;
END;
/
标签:HERE test cursor count() 数据 into index commit etc
原文地址:https://www.cnblogs.com/lwq9614/p/13201019.html