Don't use a cursor. Just use an update. Let sql do all the work.
do you mean take away the follwoing?
cursor c1 is
select * from table_A for update;
cursor c2 is
select * from table_B for update;
I take away the loop is much fast, but all the tutorial is user cursor with loop, what is wrong?
> do you mean take away the follwoing?
Using a cursor/for loop for updating is best avoided if possible.
Instead, just use 1 sql statement to do the whole thing.
Maybe a merge:
merge into table_a a
using table_x x
on (a.some_key = x.some_key)
when matched then update
set a.salary = x.new_salary;