Posts

Showing posts from November, 2010

Exception

1) What is Exception Handling? PL/SQL provides a feature to handle the Exceptions which occur in a PL/SQL Block known as exception Handling. Using Exception Handling we can test the code and avoid it from exiting abruptly. When an exception occurs a messages which explains its cause is received. PL/SQL Exception message consists of three parts. 1) Type of Exception 2) An Error Code 3) A message By Handling the exceptions we can ensure a PL/SQL block does not exit abruptly. 2) Structure of Exception Handling. The General Syntax for coding the exception section   DECLARE    Declaration section   BEGIN    Exception section   EXCEPTION   WHEN ex_name1 THEN     -Error handling statements   WHEN ex_name2 THEN     -Error handling statements   WHEN Others THEN    -Error handling statements END; General PL/SQL statements can be used in the Exception Block. When a...