Subject Re: [ib-support] Foreign Key -- Alter Table fails -- could not find UNIQUE INDEX with specified columns
Author Ann Harrison
At 01:24 PM 3/27/2002 +1100, David K. Trudgett wrote:

>The problem happens with this bit of SQL:
>
> 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

Ah. The message is misleading. We require a constraint
on the columns in TABLE2 - either PRIMARY KEY or UNIQUE.
A unique index won't do.

Regards,

Ann