Re: Null column in Primary Key
Posted in 1997
thood29@idt.net ("Timothy M. Hood") wrote: :>Does Informix allow columns that can have a null value to be part of the :>primary key? : :Yes, but it's generally not a good idea from a data modelling :perspective, regardless of which database you use. Keep in mind that a :column marked as "unique" can only have 1 null row with a null value. I didn't see the original post asking the above question, but the answer is wrong, at least for my Online 7.10.UC1. I also think it's wrong according to the ANSI SQL standard. In a primary key non of the columns that make up that key can be null. It's another issue if you do not define a primary key, only a unique index. In that case the columns may be null. The null is treated by Informix as a value here (contrary to the normal idea of a null), and as long as all "values" are unique it's ok for the unique index. 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