Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: 1 very small question for a fundamental concept.

Re: 1 very small question for a fundamental concept.

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: 3 Oct 2003 03:09:27 -0700
Message-ID: <1a75df45.0310030209.26ffe88e@posting.google.com>


xav_x_at_noos.fr (Xavier Autret) wrote i

> select TOTO from BABA where TOTO <> 1;
> select TOTO from BABA where TOTO <> 1 or TOTO is null;
>
> why first statement does not return null values?
> Am I obliged to specify the statement "or TOTO is null" ?
> "1 <> null" condition is true or not?
>
> does that behaviour can be circumvented?

Xavier, my 2'c. :-)

NULL is *not* a value. It is a *state*.

This is a fundemental principle. And the cause for confusing when it comes to dealing with NULLs

NULL is treated as a value (which it is NOT!) and value operators (e.g. equal, not equal, etc.) are used on it. This IMO is a case of ignorance instead of a problem with NULL's behaviour.

NULL requires the use of state operators like IS and IS NOT.

This is the expected and the correct behaviour. You will find the exact same behaviour when dealing with OO languages and NULL objects (though you can use the = and != in many OO languages - but then this still indicate state comparison and and not value comparison in such a case).

--
Billy
Received on Fri Oct 03 2003 - 05:09:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US