Re: NULL comparisions

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 15 Oct 1999 08:54:05 -0400
Message-ID: <miMHOMRINjm6jXaXWJ6aJLovzBcq_at_4ax.com>


A copy of this was sent to "arvind" <arvind_at_mciworld.com> (if that email address didn't require changing) On Fri, 15 Oct 1999 02:26:56 GMT, you wrote:

>You can also use
>
>If Nvl(box1, 'aaa') = Nvl(box2, 'aaa') then
>.

I think that is what i said:

>>if ( box1 = box2 or ( box1 is null and box2 is null ) ) then....
>>
>>
>>
>>or, if you have some 'invalid' value for box1 and box2 (some value they
>cannot
>>possibly have) you can:
>>
>>if ( nvl(box1,'ThatValue') = nvl(box2,'ThatValue') ) then
>>

but I added the important caveat that you must pick "some 'invalid' value for box1 and box2". If 'aaa' is a value value that either box1 or box2 can be expected to have -- just using 'aaa' is incorrect.

>.
>.
>end if
>
>HTH
>Arvind Balaraman
>Thomas Kyte wrote in message ...
>>A copy of this was sent to "Roger Johnson" <johnsonr_at_matrixy.com>
>>(if that email address didn't require changing)
>>On Thu, 14 Oct 1999 08:11:12 -0400, you wrote:
>>
>>>Hi,
>>>
>>>How do I check if two textboxes (say box1 and box2) are both empty. I am
>>>testing for equality.
>>>Apparently even if both are empty, they are still not considered equal.
>So
>>>if (box1 = box2) always
>>>returns false when both boxes are empty. I want it to return true. Is
>>>there a special check for null values?
>>>
>>>Thanks.
>>>
>>
>>
>>if ( box1 = box2 or ( box1 is null and box2 is null ) ) then....
>>
>>
>>
>>or, if you have some 'invalid' value for box1 and box2 (some value they
>cannot
>>possibly have) you can:
>>
>>if ( nvl(box1,'ThatValue') = nvl(box2,'ThatValue') ) then
>>
>>
>>--
>>See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to
>Oracle8i'...
>>Current article is "Part I of V, Autonomous Transactions" updated June
>21'st
>>
>>Thomas Kyte tkyte_at_us.oracle.com
>>Oracle Service Industries Reston, VA USA
>>
>>Opinions are mine and do not necessarily reflect those of Oracle
>Corporation
>

-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Fri Oct 15 1999 - 14:54:05 CEST

Original text of this message