1.

How can a name be assigned to an unnamed PL/SQL Exception Block?

Answer»
  • This can be done by using PRAGMA called EXCEPTION_INIT.
  • This gives the flexibility to the programmer to instruct the compiler to provide custom error messages based on the BUSINESS LOGIC by overriding the pre-defined messages during the COMPILATION time.
  • Syntax:
DECLARE exception_name EXCEPTION; PRAGMA EXCEPTION_INIT (exception_name, error_code); BEGIN // PL/SQL LogicEXCEPTION WHEN exception_name THEN // Steps to handle exceptionEND;


Discussion

No Comment Found