views:

54

answers:

1

hi, i have the following situation.

table looks like this

CREATE TABLE CompetitionsLanguages (
  competition REF CompetitionType SCOPE IS Competitions,
  language REF LanguageType SCOPE IS Languages
);

i need this table to have a unique constraint on (competition,language) combination. oracle tells me that i cant put a UNIQUE or PK on collumns that reference other tables.

is it possible to somehow avoid the unique, using the CHECK, or some sort of a TRIGGER?

thank you

+1  A: 
CREATE UNIQUE INDEX unqIndex
    ON CompetitionsLanguages(CompetitionsLanguages, CompetitionsLanguages);
Marius Burz
+1 Interesting that this works when creating a UNIQUE CONSTRAINT fails with ORA-02329.
APC