3 Replies Latest reply on Mar 8, 2011 8:14 PM by Matte

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

    551374
      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