1. declare
  2.   cursor [del_cursor] is select a.*, a.rowid row_id from [table_name] a order by a.rowid;
  3.   begin
  4.   for v_cusor in [del_cursor] loop
  5.   if v_cusor.[time_stamp] < to_date('2014-01-01','yyyy-mm-dd') then
  6.   delete from [table_name] where rowid = v_cusor.row_id;
  7.   end if;
  8.   if mod([del_cursor]%rowcount,1000)=0 then
  9.   commit;
  10.   end if;
  11.   end loop;
  12.   commit;
  13.   end;
  14.  

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。