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: Char vs Varchar2 and NULL

Re: Char vs Varchar2 and NULL

From: Jurij Modic <jmodic_at_src.si>
Date: Wed, 09 Sep 1998 07:20:20 GMT
Message-ID: <35f62921.3685019@news.siol.net>


On 9 Sep 1998 02:37:22 GMT, jpmakar_at_aol.com (Jpmakar) wrote:

>Beware the Oracle NULL. It does not mean 'NULL', it means 'undefined'. I am
>told but have not checked, that
>
>IF NULL = NULL THEN
>
>will always evaluate to false for the above reason.

Of course the expression IF NULL != NULL THEN will allways evaluate to FALSE also.

However, there is an exceptions in Oracle's SQL where one NULL value will be equal to another NULL: in a DECODE function!

Here is an example:

SQL> SELECT DECODE(NULL,NULL,'NULL is equal to NULL',

  2                          'NULL isn''t equal to NULL')
  3 FROM dual;

DECODE(NULL,NULL,'NUL



NULL is equal to NULL

SQL> Regards,
--
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)



The above opinions are mine and do not represent any official standpoints of my employer Received on Wed Sep 09 1998 - 02:20:20 CDT

Original text of this message

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