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

Home -> Community -> Usenet -> c.d.o.tools -> Re: NULL value EQUALS to EMPTY string?!

Re: NULL value EQUALS to EMPTY string?!

From: Lou Degenaro <degenaro_at_watson.ibm.com>
Date: 2000/03/02
Message-ID: <38BE9546.126026B@watson.ibm.com>#1/1

This seems wrong to me.

If the field is initialized to NULL, then a search for IS NULL should return that row. If the field is initialized to the empty string, then the search for IS NULL should not return that row. The
converse should also be true.

In short, the empty string is different from null and should be treated as such. It does not seem at all intuitive that when a field is initialized to the empty string that a search for IS NULL will match it.

It should be noted that db2 behaves as one might intuitively expect.

Lou Degenaro
degenaro_at_watson.ibm.com

TurkBear wrote:

> Furthermore,
> Nothing is equal to NULL ( That is, no thing, not the quantity nothing) not even
> NULL
>
> the only operators for use with NULL are IS and NOT IS
>
> select x from y where z is null; or
> select x from y where z is not null;
> -------------
> When inserting, a empty string '' is considered NULL, a blank string ' ' is a
> blank string that can be selected or excluded with standard Sql syntax...
>
> select x from y where z <> ' ';
> select x from y where z = ' ';
> select x from y where z > ' ';
> ..etc.
>
> all work on blank strings, but not for empty (NULL) strings...
>
> Just more to think about,
> John G
>
> "Michel Cadot" <micadot_at_netcourrier.com> wrote:
>
> >Your statements show it to you:
> >empty string is NOT equal to null,
> >empty string IS null.
>
> -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
> http://www.newsfeeds.com The Largest Usenet Servers in the World!
> ------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
Received on Thu Mar 02 2000 - 00:00:00 CST

Original text of this message

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