Branching to or from an Exception Handler Assignment Help

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

Branching to or from an Exception Handler:

A GOTO statement cannot branch into an exception handler; nor can it branch from an exception handler into the current block. For instance, the following GOTO statement is illegal:

DECLARE

pe_ratio NUMBER(3,1);

BEGIN

DELETE FROM stats WHERE symbol = 'XYZ';

SELECT price / NVL(earnings,0) INTO pe_ratio FROM stocks

WHERE symbol = 'XYZ';

<<my_label>>

INSERT INTO stats (symbol, ratio) VALUES ('XYZ', pe_ratio);

EXCEPTION

WHEN ZERO_DIVIDE THEN

pe_ratio := 0;

GOTO my_label; # an illegal branch into current block#

Therefore, a GOTO statement can branch from an exception handler into an enclosing block.

Exceptions Propagate Unhandled Exceptions
User-Defined Exception Using SQLCODE and SQLERRM
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