plsql - which exception will return? -


view exhibit examine pl/sql code.

set serveroutput on declare   past_due exception;   acct_num number; begin   declare     past_due exception;     acct_num number;     due_date date    := sysdate -1;     todays_date date := sysdate;   begin     if due_date < todays_date       raise past_due;     end if;   end; exception when past_due   dbms_output.put_line('handling past_due exeption.'); when others   dbms_output.put_line('could not recognize rxception.'); end; 

which statement true execution of code?

a. exception raised in code handled exception handler past_due exception.

b. not execute because cannot declare exception similar name in subblock.

c. past_due exception raised in subblock causes program terminate abruptly because there no exception handler in subblock.

d. past_due exception raised enclosing block not propagated outer block , handled when others exception handler.

in dumps answer c think d

(d) closest being correct, it's not right. past_due exception raised in inner block not same past_due exception caught in outer block. thus, inner block's past_due exception caught outer block's other handler. try running code , you'll see prints "could not recognize rxception.". what's incorrect answer (d) says "...the past_due exception...is not propagated outer block...". wrong - exception is propagated outer block there's no specific handler (nor can there context in exception declared not available) it's handled when others... handler. thus, in opinion none of answers correct.

share , enjoy.


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -