Search notes:

Oracle PL/SQL: Exception Handlers

In a PL/SQL block, the exception handler is an optional portion at the blocks tail, introduced with the keywords EXCEPTION WHEN.
declare

  …         // Exceptions thrown in the declare section are NOT
            // handled in the exception handler below.
   
begin

  do_stuff; // Exceptions thrown in the exceutable section ARE
            // handled in the exception handler below.:w

EXCEPTION WHEN …

  /* The exception handler goes here. */

end;
/

See also

sqlerrm and sqlcode.
ORA-06512: at , line N
An exception handler can use dbms_utility.format_error_backtrace to find the source code line that caused the exception.

Index