Re: NULLs in columns referencing foreign keys
Posted in 1997
dave@fast.thomases.com (Dave Thomas) wrote: :On Sat, 26 Apr 1997 11:06:39 +0100, David Williams wrote: :> In article <slrn5m2cae.ec0.dave@fast.thomases.com>, Dave Thomas :> <dave@fast.thomases.com> writes :> > :> >Someone in the office has got me thinking about the use of NULLs in columns :> >that reference other tables. :> :> ANY CONDITION IR EXPRESSION THAT INVOLVES NULL ALWAYS EVALUATES TO :> NULL WHICH IS FALSE. : :Except I thought that technically NULL is unknown, not FALSE. : :Hence my question. Except for the flaw in SQL that it doesn't realy know about unknown. You have to use "IS (NOT) NULL" to explisitly test for unknown. In all other cases NULL is the same as false for testing purposes. The real truth table (for the SQL where clause and I4GL if statement) for AND is: true false null true true false false false false false false null false false false For or its: true false null true true true true false true false false null true false false This is unfortunately not the way it's presented in the Informix manuals, but this is the way it works. Nils.Myklebust@idg.no NM Data AS, P.O.Box 9090 Gronland, N-0133 Oslo, Norway My opinions are those of my company The Informix FAQ is at http://www.iiug.org