Saturday 26 May 2012

How is an exception raised and handled? | PL SQL

 When a runtime error occurs, an exception is raised. The exception is handled when this error is successfully handled by  the PL/SQL code and is not allowed to propagate to the outward environment. Compilation error cannot be handled within the program; only runtime errors can be handled within the PL/SQL code.
An exception can be raised:
=>    By a runtime Oracle error
=>    By the RAISE statement
=>    By calling the RAISE_APPLICATION_ERROR procedure
After an exception is raised, the control is passed to the exception section, where the code is written about how to handle the error that has occurred. The control cannot pass back to the executable section of the same block after the exception is handled.