Explain How do we handle exceptions / errors in stored procedures?

Submitted by: Administrator
Exceptions can be handled in various ways in the stored procedures. Method (1) could be using EXCEPTION block in the procedure within which use WHEN <exceptionname> THEN. Method (2) could be declare a variable in DECLARE section as EXCEPTION type, raise it wherever required using RAISE <exception variable name> and handle it in EXCEPTION part using WHEN clause. Method (3) could be using the keywords SQLCODE & SQLERRM to display error no and error code..
Submitted by: Administrator

Read Online Database Administration Job Interview Questions And Answers