Re: Informix Certified Professional Program
Posted in 1997
In article <5dqeb0$rvu@cssun.mathcs.emory.edu>, "Walter S. Tyszka" <walt@wst.b30.ingr.com> writes >} I On 6 Feb 1997 13:48:21 -0500, >} David_Coburn/ISG/WVUS/WorldVision_at_WVUS-NOTES@wvccg.wvus.org (David >} Coburn/ISG/WVUS/WorldVision) wrote: >} >< STUFF DELETED HERE > >} >} I reviewed what was likely one of the early tests which asserted, >} among other things that a space and a NULL are equivalent. I noted 73 >} questions that were either flat out wrong or ambiguous. Maybe the >} test is now the greatest thing in the world to determine someone >} proficiency with Informix. >} >} And I could be wrong >} >} >} NAH >} >} >} >Do you mean to say that a space and a NULL are NOT equivalent? > >According to Informix: NULL means unknown, so comparing anything to NULL >will evaluate as true - since you can not tell for sure whether the two >values are different. Any expression involving a null evaluates to null which is not true. E.g. INITIALIZE my_var TO NULL IF my_var = " " THEN PRINT "TRUE" ELSE PRINT "FALSE END IF What happens?....well (NULL=" ") evaluates to NULL which is not true so "FALSE" gets printed. INITIALIZE my_var TO NULL IF my_var != " " THEN PRINT "TRUE" ELSE PRINT "FALSE END IF What happens?....well (NULL!=" ") evaluates to NULL which is not true so "FALSE" gets printed! Get the idea! Always check for nulls :- INITIALIZE my_var TO NULL IF ((my_var != " ") OR (my_var IS NULL)) THEN PRINT "TRUE" ELSE PRINT "FALSE END IF This evaluates to ( (NULL) OR (TRUE)) which is always TRUE. -- David Williams