Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Two-field unique constraint

Two-field unique constraint

From: Kalle W <kawi9365NOkaSPAM_at_student.uu.se.invalid>
Date: 2000/07/22
Message-ID: <1509546a.327057e7@usw-ex0105-035.remarq.com>#1/1

I wonder if there is a way to make a constraint on a table so that the combination of two fields has to be unique but not forcing each field by itself to be unique?

example:

Ive got a table WORDS with field WORD_ID,CATEGORY_ID and WORDTEXT. WORD_ID is a primary key. CATEGORY_ID is a foreign key and WORD_TEXT is just the text of the word. I wonder if there is a way to make a contraint so that there cant be two(or more) WORD_ID's with the same CATEGORY_ID and WORD_TEXT.

/Kalle


Got questions? Get answers over the phone at Keen.com. Up to 100 minutes free!
http://www.keen.com Received on Sat Jul 22 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US