Posts

Showing posts with the label Exception Handling

Exception Handling

  EXCEPTION Handling à An exception in PL/SQL block is raised during exception of a block. It terminates the main body of action means a block always terminates when pl/SQL raises an exception. à We can specify an exception handler to perform final action. à If an exception raised in the executable block with there is no exception handler, then the PL/SQL block terminates with the failure. If exception is handled then the Pl/SQL block terminates successfully. à Only one exception section is allowed with in single block and if more than one exception is required, we must use nested blocks. à The exception handling consists of handlers of all the exceptions. à Each exception handler consists of a when clause which specifies an exception that has to be handled. à Syntax Exception When <exception 1…> then    Sql statement1;    Sql statement2; When others then    Sql statement1;    Sql statement2; End; ...