Subject | Re: [ib-support] Foreign Key -- Alter Table fails -- could not find UNIQUE INDEX with specified columns |
---|---|
Author | Ann Harrison |
Post date | 2002-03-27T19:58:14Z |
At 01:24 PM 3/27/2002 +1100, David K. Trudgett wrote:
on the columns in TABLE2 - either PRIMARY KEY or UNIQUE.
A unique index won't do.
Regards,
Ann
>The problem happens with this bit of SQL:Ah. The message is misleading. We require a constraint
>
> ALTER TABLE TABLE1
> ADD CONSTRAINT FK_TAB1TAB2
> FOREIGN KEY (COL1, COL2)
> REFERENCES TABLE2 (COL1, COL2);
>
>The error:
>
> Statement failed, SQLCODE = -607
>
> unsuccessful metadata update
> -could not find UNIQUE INDEX with specified columns
on the columns in TABLE2 - either PRIMARY KEY or UNIQUE.
A unique index won't do.
Regards,
Ann