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: Empty strings are not NULL

Re: Empty strings are not NULL

From: Jan Nowitzky <nowitzky_at_informatik.uni-jena.de>
Date: Fri, 08 Oct 1999 08:42:44 +0200
Message-ID: <37FD9264.F687202B@informatik.uni-jena.de>


Hi,

unfortunately in 8.1.5 an empty string will be converted to 'null'. This is questionable and goes not conform with SQL. An empty string is not the same as 'null'. Look at following:

SQL> create table tt (a varchar(10), b char(2));

Tabelle wurde angelegt.

SQL> insert into tt values ('1#','');

1 Zeile wurde erstellt.

SQL> select * from tt where b is null;

A B
---------- --
1#

SQL> insert into tt values (null,'nu');

1 Zeile wurde erstellt.

SQL> select * from tt where b is null;

A B
---------- --
1#

SQL> select * from tt where a is null;

A B
---------- --

           nu

SQL> select * from tt where b='';

Es wurden keine Zeilen ausgewählt

-> tested on Oracle8.1.5 on NT.
Bye, Jan

seb wrote:
>
> Hi all,
>
> I am using Oracle 8.0.4 on NT.
>
> The "Deprecated and Desupported Features" section in
> "Getting to Know Oracle8 and the Oracle8 Enterprise Edition"
> describes that strings of a length of zero will no longer by
> equivalent to NULL in future versions.
>
> Is this true in 8.0.5 or 8.1.5 ?
>
> Thanks!
> Seb.

--



Jan Nowitzky
Friedrich-Schiller-Universität o Institut für Informatik
Received on Fri Oct 08 1999 - 01:42:44 CDT

Original text of this message

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