Update statement not working PL/SQL block
735639Dec 10 2009 — edited Dec 14 2009Hi friends,
My code is written the following way:
declare
var1 number;
var2....
Cursor c1 <select something>;
Cursor c2 <select something>
Begin
Insert into table1 <different values>;
Commit;
/* first update statement */
Update table1 set table1.col3 = (select col3 from table2 where table2.col1 = table1.col1 and table2.col2 = table1.col2);
commit ;
/* 2nd update statement */
update table1 set table1.col4 = (select col4 from table3 where table3.col1 = table1.col1 and table3.col2 = table1.col2);
commit ;
for r2 in c2 loop
update table1
end loop;
end;
This code works till 1st update statement. But after that, even if I let my code run overnight, nothing happens. There are appropriate indexes on tables where join is done. All tables are in one schema.
What could be the reason?