| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Foreign key in Oracle Sql
>> I think NULL means a lack of a value .... I think a zero length
string
is a zero length string from twoentirely different things. BTW ... NULL
in Oracle does not have single quotes around it.
..<<
I think you aren't getting it
let's see if Oracle can compare two known zero-length strings. One would not expect comparing to NOT NULL values result in UNKNOWN, but strangely enough that's the case
select case when ''='' then 'same string'
when ''<>'' then 'different strings'
else 'unknown' end t from dual
T
let's see if Oracle can compare a known zero-length string to another known string
select case when ''='a' then 'same string'
when ''<>'a' then 'different strings'
else 'unknown' end t from dual
T
How come? The reason is simple: Oracle implicitly converts '' to null, see for yourself:
select case when '' is null then 'this known string is converted to
NULL'
else 'this known string is not converted to NULL' end t from dual
T
![]() |
![]() |