Question: The following code does not violate any constraints and will not raise an ORA - 0 2 2 9 2 error. What will happen when

The following code does not violate any constraints and will not raise an ORA-02292 error. What will happen when the code is executed?
BEGIN
DECLARE
e_constraint_violation EXCEPTION;
PRAGMA EXCEPTION_INIT(e_constraint_violation, -2292);
BEGIN
DBMS_OUTPUT.PUT_LINE(Inner block message);
END;
EXCEPTION
WHEN e_constraint_violation THEN
DBMS_OUTPUT.PUT_LINE(Outer block message);
END;
Inner block message will be displayed.
The code will fail because the exception is declared in the inner block but is referenced in the outer block. (*)
Outer block message will be displayed.
The code will fail because line 4 should read: PRAGMA EXCEPTION_INIT(-2292, e_constraint_violation);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!