Re: Isn't '' and NULL different???

From: Robert Fazio <rfazio_at_home.com.nospam>
Date: Tue, 10 Jul 2001 12:03:42 GMT
Message-ID: <yaC27.12122$Y6.3743087_at_news1.rdc2.pa.home.com>


In 8.1.6 I believe that changed, but in earlier releases of oracle that was the way oracle chose to handle it. '' was converted to NULL. That is no longer the case though.

--
Robert Fazio
Senior Technical Analyst
dbabob_at_yahoo.com

"Manoj" <manoj_usa_at_yahoo.com> wrote in message
news:2fb90e4c.0107100005.729195c9_at_posting.google.com...

> Oracle is handling inserts of '' (empty string) in a very strange way.
> For inserts its treating '' as NULL (so if a table t1 has field c1
> which is say "char(10) NOT NULL" and I try inserting '' into it then I
> get an error saying NULL not allowed). This is strange as in RDBMSs ''
> is not really NULL.
>
> Another strange thing is that in select statments '' and NULL are not
> treated as same. eg.
> create table t2(c1 char(10) NULL);
> insert into t2 values('');
> select * from t2 where c1 = '' --> this doesn't return any rows (this
> behavious is what would happen in other RDBMSs)!!
>
>
> The behavious of Oracle in insert for '' seems strange. What do you
> Oracle gurus feel about this? Is there any way in which I can change
> this behaviour to make it the same as other RDBMSs?
>
> Thanks,
> - Manoj
Received on Tue Jul 10 2001 - 14:03:42 CEST

Original text of this message