Daman
asked on
What is the output of the sample code above, assuming SERVEROUTPUT is set ON?
my_table
Name Null? Type Constraint
---- -------- ------------ -----------
ID NOT NULL NUMBER PRIMARY KEY
NAME VARCHAR2(20)
DECLARE
ln_id my_table.id%TYPE;
-- Define exception for NOT NULL error.
missing_value EXCEPTION;
PRAGMA EXCEPTION_INIT(missing_val ue,-1400);
BEGIN
ln_id := NULL;
DBMS_OUTPUT.PUT_LINE(NVL(T O_CHAR(ln_ id),'NULL' ));
EXCEPTION
WHEN VALUE_ERROR THEN
DBMS_OUTPUT.PUT_LINE('Valu e Error');
WHEN missing_value THEN
DBMS_OUTPUT.PUT_LINE('Miss ing Value');
END;
What is the output of the sample code above, assuming SERVEROUTPUT is set ON?
Choice 1
Value Error
Choice 2
Missing Value
Choice 3
0
Choice 4
NULL
Choice 5
The code will not compile.
Name Null? Type Constraint
---- -------- ------------ -----------
ID NOT NULL NUMBER PRIMARY KEY
NAME VARCHAR2(20)
DECLARE
ln_id my_table.id%TYPE;
-- Define exception for NOT NULL error.
missing_value EXCEPTION;
PRAGMA EXCEPTION_INIT(missing_val
BEGIN
ln_id := NULL;
DBMS_OUTPUT.PUT_LINE(NVL(T
EXCEPTION
WHEN VALUE_ERROR THEN
DBMS_OUTPUT.PUT_LINE('Valu
WHEN missing_value THEN
DBMS_OUTPUT.PUT_LINE('Miss
END;
What is the output of the sample code above, assuming SERVEROUTPUT is set ON?
Choice 1
Value Error
Choice 2
Missing Value
Choice 3
0
Choice 4
NULL
Choice 5
The code will not compile.
[modder]
[modder]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.