光辉飞翔

导航

 
  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.  

posted on 2019-04-17 19:48  光辉飞翔  阅读(292)  评论(0编辑  收藏  举报