You execute the following block of code:
Which statement is true about the outcome?
A. Both Output statements show different values.
B. Both output statements show exactly the same values.
C. It gives an error because the nested blocks are not labeled.
D. It gives an error because the V_CUSTOMER variable have different types in the nested blocks
Answer:A
The output is :
Customer 201 rating is GOOD
Customer Womansport rating is GOOD
DECLARE
v_customer Varchar2(50) := ‘Womansport’ ;
v_credit_rating Varchar2(50) := ‘EXCELLENT’ ;
BEGIN
DECLARE
v_customer number(7) := 201 ;
v_name Varchar2(25) := ‘Unisport’ ;
BEGIN
v_credit_rating := ‘GOOD’ ;
Dbms_Output.Put_Line(‘Customer ‘||v_customer||’ rating is ‘||v_credit_rating);
END;
Dbms_Output.Put_Line(‘Customer ‘||v_customer||’ rating is ‘||v_credit_rating);
END;
/