tags:

views:

468

answers:

1

The loop below is callign a proc that does various 'things'

If it should throw an exception it also 'raises' it. I want to catch it and ignore it and allow the loop to continue processing the next value in the array.

Thanks

WHILE indx IS NOT NULL LOOP

    table_dump_csv(tableList(indx), tableList(indx) || '.csv');

    indx := tableList.NEXT(indx);
END LOOP;
+1  A: 

One possible approach...

   WHILE indx IS NOT NULL LOOP

      BEGIN
         table_dump_csv(tableList(indx), tableList(indx) || '.csv');
      EXCEPTION
         WHEN OTHERS THEN
            -- Handle/Ignore the exception as appropriate
      END;


      indx := tableList.NEXT(indx);

   END LOOP;

Alternatively you could change the procedure into a function which returns a success/failure code.

cagcowboy
Additionally, if you want to ignore and have no program logic (e.g logging) then you'll need to add "NULL;" to the exception handler in order to get it to compile.
darreljnz