1. 程式人生 > >oracle簡單,移動優化案例

oracle簡單,移動優化案例

(接上一篇未完的補序) 點選上一篇

不好意思,接著補全多行遊標

—多行遊標 ,批量遊標

declare maxrows number default 100000; rowid_table dbms_sql.urowid_table; acct_skid_table dbms_sql.Varchar2_Table; CURSOR cur_update IS SELECT t2.owner,t1.rowid from t1,t2 where t1.object_id = t2.object_id ORDER BY t1.ROWID; begin open cur_update; loop EXIT WHEN cur_update%NOTFOUND; FETCH cur_update bulk collect into acct_skid_table, rowid_table limit maxrows; forall i in 1 … rowid_table.count update t1 set t1.owner = acct_skid_table(i) where rowid = rowid_table(i); commit; end loop; close cur_update; end; /