Re: Can anyone explain the logic in this for me??

From: Tom McClelland <tom.mcclelland_at_mondas.com>
Date: 3 Mar 2002 11:31:50 -0800
Message-ID: <cb748650.0203031131.2a345499_at_posting.google.com>


Most of this problem is caused by the curious mangling of the Oracle parser of blank strings into nulls.

AnythingatAll = null is always false. Because the value of null is indeterminate.

AnythingatAll is null is true when AaA is null.

Bizarrely Oracle because of the blank string mangling will also return false from AnythingatAll>'' which is a direct contradiction of intuitive behaviour.

To add to the confusion it is not unknown for some parsers in other SQL dialects to mangle '=' to 'is' when the rhs is the constant null, which is an incorrect attempt at helpfulness leading to error when porting code from one platform to another.

Regards

jp_boileau_at_yahoo.com (J.P.) wrote in message news:<7e388bc3.0203011219.9e6e569_at_posting.google.com>...
> Now this is a bit puzzling...
>
> 1* SELECT 'X' FROM DUAL WHERE '' = NULL
> SQL> /
>
> no rows selected
>
> Elapsed: 00:00:00.00
> SQL> SELECT 'X' FROM DUAL WHERE '' IS NULL
> 2 /
>
> '
> -
> X
>
>
> Now why is the empty string ( '' ) <> null but the same empty string IS NULL ?
>
> JP
Received on Sun Mar 03 2002 - 20:31:50 CET

Original text of this message