Exceptions Propagate Assignment Help

Assignment Help: >> Branching to or from an Exception Handler - Exceptions Propagate

Exceptions Propagate:

When an exception is raised, if PL/SQL cannot search a handler for it in the subprogram or current block, the exception propagates. This is, the exception reproduces itself in successive enclosing blocks until a handler is found or there are no more blocks to find. In the latter case the PL/SQL returns an unhandled exception error to the host environment.

An exception can propagate beyond its scope, which is, beyond the block in that it is declared. Let consider the subsequent example:

BEGIN

...

DECLARE     ---------- sub-block begins

past_due EXCEPTION;

BEGIN

...

IF ... THEN

RAISE past_due;

END IF;

END;   ------------- sub-block ends

EXCEPTION

...

WHEN OTHERS THEN

ROLLBACK;

END;

Since the block in that it was declared has no handler for the exception named past_due, which propagates to the enclosing block. In addition, according to the scope rules and enclosing blocks cannot reference exceptions declared in a sub-block. Then, only an OTHERS handler can catch the exception.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd