首页 > 代码库 > 删除大表数据

删除大表数据

declare     cursor mycursor is SELECT  ROWID FROM tpr_zjjx1 WHERE jxrq=to_date(2013-06-30,yyyy-mm-dd)  order by rowid;     type rowid_table_type is  table  of rowid index by pls_integer;   v_rowid   rowid_table_type;BEGIN   open mycursor;   loop     fetch   mycursor bulk collect into v_rowid  limit 5000;        exit when v_rowid.count=0;     forall i in v_rowid.first..v_rowid.last        delete from tpr_zjjx1  where rowid=v_rowid(i);     commit;   end loop;   close mycursor;END;

 

删除大表数据