Re: Null variables
Posted in 1998
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.