What is the value of l_child_number? - ProProfs Discuss
Topics
Products
Follow Us:

What is the value of l_child_number?
DECLARE  l_parent_number NUMBER  := 1;BEGIN DECLARE      l_child_number NUMBER := 2; BEGIN l_child_number:= l_parent_number + l_child_number; END;     DBMS_OUTPUT.PUT_LINE(TO_CHAR(l_child_number));EXCEPTION   WHEN OTHERS THEN l_child_number := 0;      DBMS_OUTPUT.PUT_LINE(TO_CHAR(l_child_number);END;



A. 1
B. 2
C. 3
D. 0
E. None of the above.

This question is part of grvmock
Asked by Grvion, Last updated: Mar 29, 2020

+ Answer
Request

1 Answer

John Smith

John Smith

Answered Oct 04, 2016

0

DECLARE l_parent_number NUMBER := 1; BEGIN DECLARE l_child_number NUMBER := 2; BEGIN -- l_parent_number and l_child_number are in scope l_child_number := l_parent_number + l_child_number; END; -- l_child_number is no longer in scope and will -- trigger an exception DBMS_OUTPUT.PUT_LINE(TO_CHAR(l_child_number)); EXCEPTION WHEN OTHERS THEN -- exception will fire and display 0 l_child_number := 0; DBMS_OUTPUT.PUT_LINE(TO_CHAR(l_child_number); END;
 

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.