IS (NULL = 1) equal to NOT(NULL = 1)?
Date: 1996/08/21
Message-ID: <4vflmd$1fti_at_mule2.mindspring.com>#1/1
Of course not right? Oracle says it is!
I have the following *simple* code:
set serveroutput on
BEGIN
DECLARE
N NUMBER;
BEGIN
N := NULL;
IF (N = 1)
THEN
dbms_output.put_line('TRUE');
ELSE
dbms_output.put_line('FALSE');
END IF;
/* Notice the expression has been "notted" */
IF NOT(N = 1)
THEN
dbms_output.put_line('TRUE');
ELSE
dbms_output.put_line('FALSE');
END IF;
END;
END;
/
FALSE
FALSE
Now I've been doing this for a while. I know that 1 is not equal to
NULL. I thought this meant (1 = NULL) = FALSE which might be true.
However if it is true then certainly NOT(1 = NULL) would then be TRUE.
NOT of *any* expression is the opposite boolean value. But not here.
Anyway, if anyone could point out my error here please do so. I wouldn't even mind a little "... any rookie that knows anything know should know that null, etc..." stuff. Hmmm, well maybe not.
Virtually,
John Dennis Received on Wed Aug 21 1996 - 00:00:00 CEST