Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Why are empty VARCHAR2S always NULL?
"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
![]() |
![]() |