Adding User-Defined Exceptions : User Defined Exceptions « PL SQL Programming « Oracle PL/SQL Tutorial






Before raising a user-defined exception, you must first declare the exception.

The syntax is

<exception_name> exception;

When you raise the exception, you do it by using the RAISE command.

The syntax is:

raise <exception_name>;

Handle your exception just as if it were a named predefined exception. The syntax is:

when <exception_name> then








24.21.User Defined Exceptions
24.21.1.Adding User-Defined Exceptions
24.21.2.A User-Defined Exception
24.21.3.Including error messages in user-defined exceptions
24.21.4.Propagation of Exceptions between Program Units