Isn't '' and NULL different???
Date: 10 Jul 2001 01:05:23 -0700
Message-ID: <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.
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?
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)!!
Thanks,
- Manoj
Received on Tue Jul 10 2001 - 10:05:23 CEST