What is a named programmer-defined exception?
Sometimes, it is necessary for programmers to name and trap their own exceptions – ones that aren’t defined already by PL/SQL. These are called Named Programmer-Defined Exceptions. The syntax for the Named Programmer-Defined Exception in a procedure is: CREATE [OR REPLACE] PROCEDURE procedure_name [ (parameter [,parameter]) ] IS [declaration_section] exception_name EXCEPTION; BEGIN executable_section RAISE exception_name ; EXCEPTION WHEN exception_name THEN [statements] WHEN OTHERS THEN [statements] END [procedure_name]; The syntax for the Named Programmer-Defined Exception in a function is: CREATE [OR REPLACE] FUNCTION function_name [ (parameter [,parameter]) ] RETURN return_datatype IS | AS [declaration_section] exception_name EXCEPTION; BEGIN executable_section RAISE exception_name ; EXCEPTION WHEN exception_name THEN [statements] WHEN OTHERS THEN [statements] END [function_name]; Here is an example of a procedure that uses a Named Programmer-Defined Exception: CREATE OR REPLACE PRO
Related Questions
- I would like to take a different class instead of whats listed for a General Education requirement. Where do I go to get this course substitution or exception?
- With exception to the planets being named after Roman gods, are there any world religions that worship the planets?
- Any exception to age qualification for reverse mortgage?