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: Compare variables / NULL syndrome

Re: Compare variables / NULL syndrome

From: TurkBear <johng_at_nospam.mm.com>
Date: Mon, 17 May 1999 15:03:24 GMT
Message-ID: <37402ec5.4824627@news.dot.state.mn.us>


Sam Jordan <sjo_at_spin.ch> wrote:

Skipped..........................

>
>Problem: if both parameter and table element are null, then
>this comparison will result to 'not true', although both results
>are the same.
>
>Is there an easy way of doing such a comparison? Checking all
>special cases (if ((a=b)or((a is null) and (b is null))) and ...)
>leads to an awful statement.
>
>bye
>--
>Sam Jordan

Unless someone has an approach to this, I believe the 'awful statement' method is the only way to do this...

NULL, as you have seen, matches nothing in an = or <> or > or < operator, only the IS NULL and IS NOT NULL special operators....

So, if there will be NULL values in your data, you must explicitly check for them....

Sorry...

Maybe someone has found a more elegant way of doing this, or perhaps you could replace your NULL values with blanks....

John Greco Received on Mon May 17 1999 - 10:03:24 CDT

Original text of this message

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