posted 17 years ago
In a table creation scrript I hvae
create or replace table EDITOR (
...
CONSTRAINT "EDITOR_UNIQUE" UNIQUE(NAME, COLUMN_NAME) ENABLE
..
)
I meant to make the combination of "NAME" and "COLUMN_NAME" be unique (neither of them is PK). In the DDL script I didn't add anything else. But it seems Oracle does not actually create such constraint for me as I can insert rows with such duplicated values. I don't know why. Somebody said I need to create a "index" for this constraint like
CREATE UNIQUE INDEX "EDITOR_UNIQUE" ON "EDITOR" ("NAME", "COLUMN_NAME")
/
what ? I thought this is not an index at all. Plus, to my understanding, if I have already such a "EDITOR_UNIQUE" constraint name, then the above "create unique index" syntax is not going to work as Oracle may complain the object ("EDITOR_UNIQUE") already exists..
anyway, I am confused. Hope someone can help me out on what I ought to do.
Thanks.