4 Replies Latest reply: Jun 21, 2014 5:20 AM by SomeoneElse RSS

    Use cursor to  select update so slower

    Hjava

      I use cursor to select update table  if  I have the bold part is much slower than without the bold part. can anyone told me why?

       

      SET serveroutput ON

       

       

      declare

      cursor c1 is  

        select * from table_A for update;

       

      cursor c2 is 

      select * from  table_B for update;

      begin

      FOR rec IN c1

      LOOP

       

       

      UPDATE table_A set (slary)=(select*....)

       

      end loop;

      close c1;

       

      open c2;

      loop

      update table_B '.....

       

      end loop

      close c2