Subject | Re: [ib-support] Fw: Problem creating foreign key |
---|---|
Author | Pavel Cisar |
Post date | 2002-01-17T13:48:20Z |
Hi,
On 17 Jan 2002, at 13:48, Graham Reeves wrote:
> I made the description the primary key and it worked.
> The problem is that I actually have more fields in the SkyStatus table.
> Therefore the primary key consists of three fields, Description being one of
> them. When I try and create the child table it still gives me the same
> error.
>
> Is there a work around??
It seems that you're discovered the root of your problem before I
was been able to react :-) Anyway, contrary to somewhat
misleading documentation, you must have a _constraint_ defined
on referenced table. The unique _index_ is not enough. Yep, the
error message IB will give you on that is misleading too :-) So, the
solution is simple:
a) Do not define unique index in referenced table.
b) Define UNIQUE or PRIMARY KEY constraint (it seems that
you'll need UNIQUE instead PK in your case) instead.
c) Create FOREIGN KEY constraint.
Best regards
Pavel Cisar
http://www.ibphoenix.com
For all your upto date Firebird and
InterBase information