Subject | Re: [firebird-support] FK confusion |
---|---|
Author | Ann W. Harrison |
Post date | 2006-07-10T19:07:38Z |
firebird@... wrote:
find a unique constraint. There are three ways of declaring that a
field or set of fields should be unique: 1) declare them to be a
primary key, 2) declare them to be subject to a unique constraint,
3) declare a unique index on them. The third exists for historical
reasons and predates SQL as InterBase's primary language. The SQL
standard requires that the referenced fields in a foreign key
constraint be subject to one of the first two. So drop the unique
index, replace it with a unique constraint, and all will be well...
Except for the odd primary key, I guess...
Cheers,
Ann
> I get this error message:It's a lousy error message. What it should say is that it couldn't
>
> This operation is not defined for system tables.Unsuccessful metadata
> update.
> Could not find UNIQUE INDEX with specified columns.
>
find a unique constraint. There are three ways of declaring that a
field or set of fields should be unique: 1) declare them to be a
primary key, 2) declare them to be subject to a unique constraint,
3) declare a unique index on them. The third exists for historical
reasons and predates SQL as InterBase's primary language. The SQL
standard requires that the referenced fields in a foreign key
constraint be subject to one of the first two. So drop the unique
index, replace it with a unique constraint, and all will be well...
Except for the odd primary key, I guess...
Cheers,
Ann