Re: Informix pop quiz
Posted in 2008
A quiz-style post asked how Informix can reject NULLs at insert time on a column that was declared as allowing nulls. The main answer offered was that the column is part of a PRIMARY KEY, since a primary key can never contain NULLs (Fernando Nunes noted this is a conceptual rule, not a storage limitation — you can't identify or reference an unknown value). A claim that one NULL row is permitted under a primary key was corrected: that's true only for a UNIQUE constraint, which permits a single NULL. The original poster never returned to confirm the intended answer.
Topics: General Discussion
dcruncher4@aim.com wrote: > Do you know that informix allows a column to be declared as null allowed > but at insert time does not allow null values to that column. Can anyone > guess how is this possible? > > PRIMARY KEY? (Just a guess, mind, I certainly couldn't be arsed to test it! :o) -- Cheers, Obnoxio the Clown http://obotheclown.blogspot.com
On Oct 10, 11:03 am, Obnoxio The Clown <obno...@serendipita.com> wrote: > dcrunch...@aim.com wrote: > > Do you know that informix allows a column to be declared as null allowed > > but at insert time does not allow null values to that column. Can anyone > > guess how is this possible? > > PRIMARY KEY? > > (Just a guess, mind, I certainly couldn't be arsed to test it! :o) > > -- > Cheers, > Obnoxio the Clown > > http://obotheclown.blogspot.com Even still, I believe you can still have one null record in a primary key constraint.
Ian Michael Gumby wrote: > On Oct 10, 11:03 am, Obnoxio The Clown <obno...@serendipita.com> > wrote: > >> dcrunch...@aim.com wrote: >> >>> Do you know that informix allows a column to be declared as null allowed >>> but at insert time does not allow null values to that column. Can anyone >>> guess how is this possible? >>> >> PRIMARY KEY? >> >> (Just a guess, mind, I certainly couldn't be arsed to test it! :o) >> >> -- >> Cheers, >> Obnoxio the Clown >> >> http://obotheclown.blogspot.com >> > > Even still, I believe you can still have one null record in a primary > key constraint. > And I believe that Informix has great marketing. But that don't make it so. :o) -- Cheers, Obnoxio the Clown http://obotheclown.blogspot.com
No, not allowed. If you create it NULL ALLOWED and then put a UNIQUE CONSTRAINT it will allow 1 NULL value in, but no more. -----Original Message----- From: informix-list-bounces@iiug.org [mailto:informix-list-bounces@iiug.org] On Behalf Of Ian Michael Gumby Sent: Friday, October 10, 2008 11:38 AM To: informix-list@iiug.org Subject: Re: Informix pop quiz On Oct 10, 11:03 am, Obnoxio The Clown <obno...@serendipita.com> wrote: > dcrunch...@aim.com wrote: > > Do you know that informix allows a column to be declared as null allowed > > but at insert time does not allow null values to that column. Can anyone > > guess how is this possible? > > PRIMARY KEY? > > (Just a guess, mind, I certainly couldn't be arsed to test it! :o) > > -- > Cheers, > Obnoxio the Clown > > http://obotheclown.blogspot.com Even still, I believe you can still have one null record in a primary key constraint. _______________________________________________ Informix-list mailing list Informix-list@iiug.org http://www.iiug.org/mailman/listinfo/informix-list
On Fri, Oct 10, 2008 at 5:37 PM, Ian Michael Gumby <im_gumby@hotmail.com> wrote: > On Oct 10, 11:03 am, Obnoxio The Clown <obno...@serendipita.com> > wrote: >> dcrunch...@aim.com wrote: >> > Do you know that informix allows a column to be declared as null allowed >> > but at insert time does not allow null values to that column. Can anyone >> > guess how is this possible? >> >> PRIMARY KEY? >> >> (Just a guess, mind, I certainly couldn't be arsed to test it! :o) >> >> -- >> Cheers, >> Obnoxio the Clown >> >> http://obotheclown.blogspot.com > > Even still, I believe you can still have one null record in a primary > key constraint. No, because you can't base an identity or create a foreign key to something that you don't know (null). It's not a physical issue. It's a concept issue. Regards. -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently...
Ian Michael Gumby wrote: > Even still, I believe you can still have one null record in a primary > key constraint. You don't know? -- Daniel A. Morgan University of Washington damorgan@x.washington.edu (replace x with u to respond)