Checking if a Collection Is Null
DECLARE
TYPE emp_name_rec IS RECORD(firstname employees.first_name%TYPE,
lastname employees.last_name%TYPE,
hiredate employees.hire_date%TYPE);
TYPE staff IS TABLE OF EMP_NAME_REC;
members STAFF;
BEGIN
-- Condition yields TRUE because we have not used a constructor.
IF members IS NULL THEN
dbms_output.Put_line('NULL');
ELSE
dbms_output.Put_line('Not NULL');
END IF;
END;
/
0 comments:
Post a Comment