User-Defined Errors : Raise Exception « PL SQL Programming « Oracle PL/SQL Tutorial






Users can explicitly raise an exception with the RAISE command.

Steps for trapping a user-defined error include the following:

Declare the name for the user exception within the declaration section of the block.

Raise the exception explicitly within the executable portion of the block using the RAISE command.

Reference the declared exception with an error-handling routine.









24.16.Raise Exception
24.16.1.User-Defined Errors
24.16.2.Raise Exception in a function
24.16.3.Raising an Exception Local PL/SQL Block
24.16.4.Avoiding exceptions raised in declaration part and exception handler
24.16.5.Raising an Exception in the Declaration Section
24.16.6.Exceptions Raised in the Exception Handler
24.16.7.Raising NO_DATA_FOUND
24.16.8.Raising a custom exception
24.16.9.Using WHEN OTHERS clause
24.16.10.Using SQLCODE and SQLERRM
24.16.11.Propogating a Server-side Customized Error Number and Error Message to client program using PRAGMA EXCEPTION_INIT