Skip Headers
Oracle® Database PL/SQL Language Reference
11g Release 2 (11.2)

Part Number E10472-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

Exception Handler

An exception handler processes a raised exception (run-time error or warning condition). The exception can be either predefined or user-defined. The run-time system raises predefined exceptions automatically, but you must raise user-defined exceptions explicitly with either a RAISE statement or the procedure DBMS_STANDARD.RAISE_APPLICATION_ERROR. The latter lets you associate an error message with the user-defined exception.

Topics:

Syntax

exception_handler ::=

exception_handler
Description of the illustration exception_handler.gif

See statement ::=.

Semantics

exception_name

The name of either a predefined exception (see Table 11-2) or a user-defined exception (see "Exception").

If a specified exception is raised, the associated statement runs.

OTHERS

Specifies all exceptions not explicitly named in the exception-handling part of the block. WHEN OTHERS is optional. If used, it must be the last exception handler in the exception-handling part of the block.

If an exception that is not explicitly named is raised, the associated statement runs.

Examples

Related Topics

In this chapter:

In other chapters: