RE: 4GL compares NULL differently
- From: "R.A. Reissaus" <r.a.reissaus@xxxxxxxxx>
- Date: Wed, 26 Oct 2005 16:07:15 +0200
You must of course realize that the number 0 is NOT equal to NULL! NULL is
not a value but a state (more or less saying 'I am not yet defined'). So it
is entirely possible that when equating to the number zero yu get different
result especialy when comparing to TRUE or FALSE wich or equally NOT the
same as NULL. True and False are constant with the respective value of the
numbers 1 and zero.
------------------------------------------------------------------------
R.A. Reissaus
Risdi, Amsterdam, the Netherlands
Ibm/Informix Consultants
Telefoon: +31(0)20 6331140 : Phone
Mobiel : +31(0)6 51185352 : Mobile
E-mail : r.a.reissaus@xxxxxxxxx
Website : www.risdi.com
------------------------------------------------------------------------
Disclaimer:
`Externe E-Mail wordt door partijen niet gebruikt voor het aangaan van
verplichtingen`
`Any e-mail messages from sending parties named in this e-mail are given
in good faith but shall not be binding nor shall they be construed as
constituting any obligation on the part of any such party.`
------------------------------------------------------------------------
> -----Oorspronkelijk bericht-----
> Van: owner-informix-list@xxxxxxxx
> [mailto:owner-informix-list@xxxxxxxx] Namens Denis Melnikov
> Verzonden: woensdag 26 oktober 2005 14:28
> Aan: informix-list@xxxxxxxx
> Onderwerp: 4GL compares NULL differently
>
> 4GL 7.32.UC2
> Solaris 2.6
>
> 4GL must compare NULL to any not-NULL value as FALSE.
> And it acts this way... sometimes.
>
> Please review the following sample:
>
> >>>>>>>>>>>>>>>>>>
> DEFINE m_inv_amt DECIMAL(12,2)
>
> FUNCTION AmtUsed()
>
> IF m_inv_amt != 0 THEN
> RETURN true
> ELSE
> RETURN false
> END IF
> END FUNCTION
> <<<<<<<<<<<<<<<<<<
>
> When m_inv_amt is NULL, AmtUsed() returns FALSE at one
> moment, and TRUE at another. And the FALSE/TRUE sequence
> doesn't change from run to run.
>
> Is it a known bug or a new feature?
sending to informix-list
.
- Prev by Date: Re: 4GL compares NULL differently
- Next by Date: Re: 4GL compares NULL differently
- Previous by thread: Re: 4GL compares NULL differently
- Next by thread: Re: 4GL compares NULL differently
- Index(es):
Relevant Pages
|