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

Home -> Community -> Usenet -> c.d.o.misc -> Re: VARCHAR2: NULL value vs. empty string

Re: VARCHAR2: NULL value vs. empty string

From: NoName <nobody_at_nowhere.com>
Date: Mon, 15 Dec 2003 17:46:08 +0100
Message-ID: <brkngk$43r$1@grillo.cs.interbusiness.it>


> If NULL is not a zero length string, then why does Oracle do this? :-
> SQL> select 'abc'||null from dual;
>
> 'AB
> ---
> abc
>
> It should return NULL, should it not?

I can assure you that empty string <> NULL value. According to Oracle 8.0 SQL Reference Manual, Chapter 3, paragraph about "Concatenation Operator":
--- start ---
Although Oracle treats zero-length character strings as nulls, concatenating a zero-length character string with another operand always results in the other operand, so null can result only from the concatenation of two null strings. However, this may not continue to be true in future versions of Oracle. To concatenate an expression that might be null, use the NVL function to explicitly convert the expression to a zero-length string. --- end ---

Regards Received on Mon Dec 15 2003 - 10:46:08 CST

Original text of this message

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