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: Why are empty VARCHAR2S always NULL?

Re: Why are empty VARCHAR2S always NULL?

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 21 Aug 2002 17:53:00 GMT
Message-ID: <3D63D36E.73CF76B3@exesolutions.com>


Wolfram Roesler wrote:

> "Vladimir M. Zakharychev" <bob_at_dpsp-yes.com> wrote in
> news:ajvnht$rq8$1_at_babylon.agtel.net:
>
> > This is not a bug, this is design decision taken by Oracle long time
> > ago and it is unlikely to change. You have to live with it - empty
> > varchar2 in Oracle was NULL, is NULL and probably will be NULL for the
> > life of Oracle database software.
> >
>
> Is there any wisdom behind that design decision, or is it merely a
> bug that had to be declared a feature for compatibility reasons?
> I find it very counter-intuitive that, for example, ''='' and
> ''!='X' are false.
>
> How do I join by an empty string, for instance? Consider:
>
> SELECT ...
> FROM t1, t2
> WHERE t1.col = t2.col;
>
> where t1.col and t2.col are both empty. NVL(colname,'') won't help
> since '' IS NULL.
>
> Thanks
> W. Roesler

Actually, as I understand it, it is the actual ANSI standard. Products that do not do this are in violation of the standard. And I believe that MS SQL Server has an ability, through some workaround, to configure things this way just so that they could claim compliance.

So if anyone wants to throw the word "bug" around they should point it at all of the other vendors.

Daniel Morgan Received on Wed Aug 21 2002 - 12:53:00 CDT

Original text of this message

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