Exceptions in a WHILE loop
MrSaoJul 20 2012 — edited Jul 20 2012Hi ,
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