Subject | Re: Restoring Foreing Key. |
---|---|
Author | Adam |
Post date | 2006-02-13T22:25:15Z |
> Hello again.In order to add a foreign key in FB 1.5, you need to be the only
> This problem is not only for a deleted FK, it happens whenever I want
> to add a FK to an existent table. The message is the same:
>
> "This operation is not defined for system tables.
> unsuccessful metadata update.
> object REFERENCED_TABLE is in use"
>
>
> What could be the problem?
active transaction that has used directly or indirectly
REFERENCED_TABLE. FB 2 does a bit better here.
To re-add the constraint, you will probably need to put the database
into shutdown mode, then add it, then take it out of shutdown mode (or
simply pick a time when no-one is in the system and all transactions
are committed / rolledback).
Be aware that since you have dropped the constraint, illegal values
could possibly have been added to the field, so the onus will be on
YOU to make sure that these illegal values are dealt with before
adding the constraint. If they are left there, you may end up with a
backup that will not restore!
Adam
>