The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments. Please have a happy and safe festive season and as always, thanks for being a member of the AskTOM community.
Thanks for the question, Michael.
Asked: July 07, 2018 - 4:59 pm UTC
Last updated: July 09, 2018 - 5:03 am UTC
Version: 12c
Viewed 10K+ times! This question is
SQL> create table t as select rownum pk, d.* from dba_objects d, 2 ( select 1 from dual connect by level <= 20 ); Table created. SQL> SQL> create index ix on t ( pk ); Index created. SQL> SQL> SQL> create or replace 2 procedure fix_row(p_idx int, p_new_val varchar2) is 3 begin 4 update t 5 set owner = p_new_val 6 where pk = p_idx; 7 end; 8 / Procedure created. SQL> SQL> set timing on SQL> begin 2 for i in 1 .. 1000000 3 loop 4 fix_row(i,upper(i)); 5 end loop; 6 end; 7 / PL/SQL procedure successfully completed. Elapsed: 00:00:36.10 SQL> SQL> update t 2 set owner = upper(pk) 3 where pk <= 1000000; 1000000 rows updated. Elapsed: 00:00:02.52 SQL> SQL>
Check out more PL/SQL tutorials on our LiveSQL tool.
PL/SQL reference manual from the Oracle documentation library