Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to create a uniqueness constraint based on two fields?
Ramon, Thomas's answer will also work for the PK constraint.
Multi-column keys are not fairly common and often necessary to support
business rules.
In the case of names I would however suggest placeing the last_name prior to the first name since this would facilitate finding all SMITH's etc.... Also in the real world it would probably be necessary to add date of birth or hire date to decrease the possibility of running into a duplicate value for a non-duplicate person. That is the possibility of two John Smith's being employed by the company is fairly high but it is very unlikely that both were born on the same day. HTH -- Mark D Powell -- Received on Wed Jan 26 2005 - 07:56:09 CST