WhichSome options will display "Hello Earth" after execution "?
(A) Declare l_total number; l_name varchar2 (10): = 'pl/SQL '; begin if l_name = 'pl/SQL 'or l_total> 100 then dbms_output.put_line ('Hello global'); else dbms_output.put_line ('Hello moon'); end if; end;/(B) declare l_total number; l_name varchar2 (10): = 'pl/SQL '; begin if l_total> 100 then dbms_output.put_line ('Hello Earth'); else dbms_output.put_line ('Hello moon '); end if; end;/(c) Declare l_total number; l_name varchar2 (10): = 'pl/SQL '; begin if l_total> 100 or l_total is null then dbms_output.put_line ('Hello global'); else dbms_output.put_line ('Hello moon '); end if; end;/(d) Declare l_total number; l_name varchar2 (10): = 'pl/SQL '; begin if nvl (l_total, 200)> 100 then dbms_output.put_line ('Hello global '); else dbms_output.put_line ('Hello moon '); end if; end ;/
Answer:Case: ACD
A: The uninitialized variable is null. The if condition is equivalent to if true or null. The preceding true will cause or to be ignored. The entire result is true.
B: The uninitialized variable is null, and the expression in the IF condition is evaluated as null,CodeWill go to Else.
C: If is null is used, and the result is true.
D: nvl converts null to 200 and returns true.