Multiple choice

Which of the following is the correct method of handling exceptions in the 'Exception' section?

  1. If exception then exception handling statements

  2. If raised_exception then exception handling statements

  3. When exception then exception handling statements

  4. When raised_exception then exception handling statements

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Exception handling prevents the program from abnormal termination. If a program encounters an exception/run time error, the control moves to the exception part where it is handled using the 'when exception then' keyword. For example: To handle a user defined exception, the statement will be  when no_data_found then dbms_output.put_line('No Records Found');