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!

Exceptions in a WHILE loop

MrSaoJul 20 2012 — edited Jul 20 2012
Hi ,

I want to do something like this
-------------------------------------------------------------------------------------------------------

While Condition
LOOP
BEGIN

Insert into table1 values(......);
Insert into table2 values(......);
Insert into table3 values(......);
Insert into table4 values(......);
Insert into table5 values(......);
Insert into table6 values(......);
condition := FALSE

EXCEPTION
When OTHERS THEN
<capture the error while inserting into an Error table>

END;
END LOOP;
-------------------------------------------------------------------------------------------------------

Now I want that If one of the insert statement within the loop fails (say table2)
the exception should be captured and next insert statement (table3) should be
executed.



How can I do this ? I guess I wont even need a loop can any one help

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2012
Added on Jul 20 2012
10 comments
1,010 views