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: Wolfram Roesler <wr_at_grp.de>
Date: Wed, 21 Aug 2002 14:39:15 +0200
Message-ID: <Xns927195BD69F7Awrgrpde@62.153.159.134>


"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 Received on Wed Aug 21 2002 - 07:39:15 CDT

Original text of this message

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