Tell Me Glossary
 

Handling Exceptions: Part 2

Previous previous|next Next Page
EXCEPTION
WHEN exception1 [OR exception2 . . .] THEN
statement1;
statement2; . . .
  [WHEN exception3 [OR exception4. . .] THEN
statement3;
statement4; . . .]
[WHEN OTHERS THEN
statement5;
statement6; . . .]
  • Begin the exception-handling section of the block with the EXCEPTION keyword.
  • Define several exception handlers, each with its own set of actions, for the block.
  • When an exception occurs, PL/SQL processes only one handler before leaving the block.
  • Place the OTHERS clause after all other exception-handling clauses.
  • You can have only one OTHERS clause.
  • Exceptions cannot appear in assignment statements or SQL statements.