Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Please ask technical questions in the appropriate category. Thank you!

FOR Loop Exception Handling

910971May 30 2012 — edited May 31 2012
Given the following code:
for x in my_cursor loop
    begin
        <<stmt_1>>
        <<stmt_2>>
    exception
        when others then
            <<log_error>>
    end;
end loop;
Say there are 5 x's in my_cursor. On element x3, stmt_1 works fine but stmt_2 throws an exception. I'd like to rollback ONLY the work done on x3 (in this case, stmt_1), then continue the loop from the next element, x4. Can this be achieved with some combination of savepoint/rollback?
This post has been answered by JustinCave on May 31 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2012
Added on May 30 2012
9 comments
68,871 views