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: Is This the varchar2 ZLS Issue?

Re: Is This the varchar2 ZLS Issue?

From: Tony Andrews <andrewst_at_onetel.com>
Date: 20 Mar 2006 02:58:30 -0800
Message-ID: <1142852310.213023.52530@u72g2000cwu.googlegroups.com>


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

Original text of this message

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