declare
v_cnt number(10);
TYPE v_idtype is table of rowid ;
v_id v_idtype ;
CURSOR cur_aqy IS
select rowid from t_cms_access_ext where id in (SELECT access_id FROM
dc_cms_acce) ;
begin
open cur_aqy ;
loop
fetch cur_aqy bulk collect into v_id limit 10000;
v_cnt := 0;
forall i IN 1..v_id.count
execute immediate 'delete from t_cms_access_ext where rowid =:1' using v_id(i);
/* forall i IN 1..v_id.count
execute immediate 'delete from t_cms_access where id =:1' using v_id;*/
commit;
/*dbms_lock.sleep(1);*/
v_cnt := v_cnt + 10000;
execute immediate 'update ls_iqy_LOG set Complete_cnt=Complete_cnt+:1 ,
update_time=sysdate ' using v_cnt;
commit;
end loop;
commit;
close cur_aqy;
dbms_output.put_line(v_cnt);
end;
/
评论