Re: ESQL/C and test on NULL
Posted in 1999
Hello Pierre. In the Informix manuals is the next example of the results of testing for null values: IF NULL = NULL ( Always FALSE ) IF NULL > NULL ( Always FALSE ) IF NULL < NULL ( Always FALSE ) Because a NULL value is undefined and you can't say that something you don't know equals to another thing you don't know. So, the only way to test for NULL is: IF variable IS NULL or IF variable IS NOT NULL Of course you can extend this comparisons to the WHERE clause of a SELECT statement, a WHILE .... >From: "Pierre Henrotay" <Pierre.Henrotay@skynet.be> >Reply-To: "Pierre Henrotay" <Pierre.Henrotay@skynet.be> >To: informix-list@iiug.org >Subject: ESQL/C and test on NULL >Date: Wed, 13 Oct 1999 22:08:24 +0200 > >Can someone explain the difference between: >- SELECT ... FROM ... WHERE ... mycolumn IS NULL >and >- SELECT ... FROM ... WHERE .... mycolumn = $hostvar >where hostval has been set to NULL appropriately via rsetnull? > >Pierre > > > Angel Gomez TelNor, S.A. Tijuana, B.C., Mexico. <Angel.Gomez@telnor.com> ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com