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 error. What will happen when the code is executed?
BEGIN
DECLARE
econstraintviolation EXCEPTION;
PRAGMA EXCEPTIONINITeconstraintviolation, ;
BEGIN
DBMSOUTPUT.PUTLINEInner block message;
END;
EXCEPTION
WHEN econstraintviolation THEN
DBMSOUTPUT.PUTLINEOuter 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 should read: PRAGMA EXCEPTIONINIT econstraintviolation;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
