Re: Null variables
Posted in 1998
Ehrmmmm! NULL = NULL yelds false? I'm afraid not :-) the result of the test is
NULL, which is of course regarded as not being true by if & case statements,
but is very far from being false...
Ciao,
Marco
______________________________________________________________________________
Marco Greco <marco@informix.com> Standard disclaimers apply!
Informix faq http://www.iiug.org/techinfo/faq/informix.htm
4glworks http://www.ctonline.it/~marcog
Informix on Linux http://www.ctonline.it/~marcog/ifmxlinux.htm
jparker@epsilon.com wrote:
>
> NULL is special. NULL doesn't equal anything because it is by definition
> undefined. So undefined != undefined (not true). Where ever you use NULL
> you cannot use an equality or inequality statement. This leads to some
> interesting things:
>
> NULL = NULL (false)
> NULL != NULL (false)
> NULL = foo (false)
> NULL != foo (false)
>
> There is therefore a special test for NULL which does not involve an
> equality statement - 'IS NULL'.
>
> IF a IS NULL THEN ....
>
> try to remember to use this power only for good.
>
> cheers
> j.
>
> "Florin Micle" <florinmicle@gsc-mbh.de> on 08/12/98 12:44:22 PM
>
> Please respond to "Florin Micle" <florinmicle@gsc-mbh.de>
>
> To: informix-list@iiug.org
> cc: (bcc: Jack Parker/Boston50/Epsilon)
> Subject: Null variables
>
> Hi all,
> Does anyone know how can I see if a passed variable into a stored
> procedure in Informix (dbaccess) has null value? I can't compare it with
> null because I get a syntax error (null - undeclared variable) if I pass
> null value into another variable the evaluation of null = null returns
> false! I wish it returned true...
> Can anyone give me a solution for this?
> Thanks,
> Florin.