View the exhibit and examine the structure of the EMPLOYEES table.
The salary of EMPLOYEE_ID 195 is 2800.
You execute the following code
What is the outcome?
A.
It gives an error because only the innermost block is labeled.
B.
It gives an error because the same variable name cannot be used across all the nested blocks.
C.
It executes successfully and displays the resultant values in the following sequence- 1000,
2800 50000, 2800.
D.
It executes successfully and displays the resultant values in the following sequence: 1000,
2800, 50000, 1000.
C
C
c
C
The value of v_sal depends on which enclosing block.
DECLARE
v_sal NUMBER(10,2):= 1000;
BEGIN
DBMS_OUTPUT.PUT_LINE (‘Salary is ‘ || v_sal);
DECLARE
v_sal NUMBER;
BEGIN
v_sal := 2800;
DBMS_OUTPUT.PUT_LINE (‘Salary is ‘ || v_sal);
DECLARE
v_sal NUMBER := 50000;
BEGIN <>
DBMS_OUTPUT.PUT_LINE (‘Salary is ‘ || v_sal);
END b3;
DBMS_OUTPUT.PUT_LINE (‘Salary is ‘ || v_sal);
END;
DBMS_OUTPUT.PUT_LINE (‘Salary is ‘ || v_sal);
END;
PL/SQL procedure successfully completed.
Salary is 1000
Salary is 2800
Salary is 50000
Salary is 2800
Salary is 1000
This is confusing because there is on more DBMS_OUTPUT here than in the exhibit.
Using the exact code in the exhibit the result is:
——-
Salary IS 1000
Salary IS 2800
Salary IS 50000
Salary IS 2800
——–
So correct answer is C
C
C