Re: null? not null?
Date: 1996/09/05
Message-ID: <50n0s1$t0u_at_inet-nntp-gw-1.us.oracle.com>#1/1
In article <322E1968.6CE6_at_natinst.com>, Dave Peckham <davep_at_natinst.com> writes:
|> I can't figure this one out:
|>
|> select rc_isr from repcode rc_country = '';
|>
|> No rows selected
|>
|> This happens even after I set rc_country = ''. However, if I use is
|> null, it finds the record.
|>
|> I though '' and null were the same.
They are. But '= NULL' and 'IS NULL' are most definitely not the same. NULL is an unknown value, and therefore can not be equal to (or not equal to) anything. So the following conditions will evaluate to NULL:
x = NULL
x != NULL
x > NULL
x < NULL
About the only thing you know about a NULL value is whether or not it is in fact NULL (the IS NULL check).
|>
|> Any thoughts? (nothing in the FAQ's)
|> ________________________________________________________________________
|> Dave Peckham
|> IS Programmer/Analyst dave.peckham_at_natinst.com
|> National Instruments http://www.natinst.com
Scott Urman Oracle Corporation surman_at_us.oracle.com
Author of _Oracle PL/SQL Programming_ ISBN 0-07-882176-2 Published by Oracle Press - http://www.osborne.com/oracle/index.htm
"The opinions expressed here are my own, and are not necessarily that of Oracle Corporation"
Received on Thu Sep 05 1996 - 00:00:00 CEST