Index | Home | Forums
Oracle PL/SQL Example 2-28 Using NULLs in Comparisons

Example 2-28 Using NULLs in Comparisons

DECLARE
   x NUMBER := 5;
   y NUMBER := NULL;
BEGIN
   IF x != y THEN  -- yields NULL, not TRUE
      DBMS_OUTPUT.PUT_LINE('x != y');  -- not executed
   ELSIF x = y THEN -- also yields NULL
      DBMS_OUTPUT.PUT_LINE('x = y');
   ELSE
      DBMS_OUTPUT.PUT_LINE('Can''t tell if x and y are equal or not.');
   END IF;
END;
/


This page was created by oracleabc.com on Feb 23,2008 00:09:02
General comments and questions regarding this document should be sent by email to info@oracleabc.com or post your comments here