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!

how to ignore error and continue with next value in PL/SQL FOR loop?

BenevenNov 12 2007 — edited Mar 8 2011
hi,

When the DROP INDEX statement fails it have to continue with the next value in FOR loop without exiting from the loop. Can anyone tell me how to do this?

DECLARE

CURSOR aud_cur IS
SELECT key_col_idx FROM audience_work where aud_ref_id between 106 and 109;

BEGIN
FOR aud_row IN aud_cur LOOP

EXECUTE IMMEDIATE
'DROP INDEX ' || aud_row.key_col_idx;

END LOOP;
END;
/

Thanks,
Noble
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 5 2011
Added on Nov 12 2007
3 comments
29,879 views