RE: Unique constraint
Posted in 1999
Ahhh you're going to make me quote book, chapter and verse!!! 2-166 Informix Guide to SQL: Syntax February 1998 CREATE TABLE Referenced and Referencing Column Requirements In a referential relationship, the referenced column is a column or set of columns within a table that uniquely identifies each row in the table. In other words, the referenced column or set of columns must be a unique or primary-key constraint. If the referenced columns do not meet this criteria, the database server returns an error. > -----Original Message----- > From: Obnoxio The Clown [SMTP:obnoxio@hotmail.com] > Sent: Friday, September 17, 1999 9:02 AM > To: WilliamR@catmktg.com; hluse@vth.colostate.edu; > informix-list@iiug.org > Subject: RE: Unique constraint > > From: William Raper <WilliamR@catmktg.com> > > > >There is a very distinct advantage: REFERENTIAL INTEGRITY. > > > >If you have a UNIQUE INDEX on a column or group of columns, you CANNOT > have > >a foreign key constraint from another table referencing those columns. > > > >If you use a UNIQUE CONSTRAINT, a unique index is created, and you CAN > have > >a foreign key constraint from another table referencing those columns. > > This isn't the same bloke who took me to task for making a silly mistake > quite recently, is it?? > > Last time I looked in the manual (1994 :) REFERENTIAL INTEGRITY was > enforced > by PRIMARY KEY and REFERENCES with NO MENTION MADE of UNIQUE > CONSTRAINTs... > :-) > > My take on UNIQUE CONSTRAINTS vs UNIQUE INDEXes is that the constraint is > just more consistent with the other declarative integrity, and there's no > other real benefit or difference. The UNIQUE CONSTRAINT just gets applied > by > a UNIQUE INDEX, anyway. > > ______________________________________________________ > Get Your Private, Free Email at http://www.hotmail.com