Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Is This the varchar2 ZLS Issue?
Mark D Powell wrote:
> A varchar2 datatype is not a string datatype. It is a variable length
> character field. Oracle treats a varchar2 column without a value as
> null.
>
> The proper way to test for or specify the presence of data is to use
> the "IS NULL" or "IS NOT NULL" clauses.
>
> where wo_request_date >= to_date('01-MAR-06')
> and wo_acct_no is null
>
> Your second query fails because NULL <> NULL. Two unknowns are not
> equal!
All correct - for Oracle. But note that the ANSI standard is that the empty string is NOT null, and "where '' = ''" should always be TRUE. This Oracle anomaly is a trap for those used to other DBMSs that honour the ANSI standard on this point. Received on Mon Mar 20 2006 - 04:58:30 CST