Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update statement not working PL/SQL block

735639Dec 10 2009 — edited Dec 14 2009
Hi 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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 11 2010
Added on Dec 10 2009
14 comments
5,750 views