Subject | Re: Creating Foreign keys |
---|---|
Author | Alexander V.Nevsky |
Post date | 2003-04-25T13:48:09Z |
--- In ib-support@yahoogroups.com, "Riho-Rene Ellermaa"
<r.ellermaa@h...> wrote:
No, there is not such a limitation, reason is simply we can't create
FK if server is'nt sure nobody work with "master" table at this
moment. If anybody (including your own connection) touched table
MASSGROUPS, it is in use. So, to create FK you should be a) sure you
alone is connected to database, including secondary connections from
your computer (from Delphi IDE etc) b) you did'nt touched master
table in statements within this connection. In practice when you
encounter this most simply way is to check condition a) and close your
connection, reconnect and repeat statement.
Best regards, Alexander.
<r.ellermaa@h...> wrote:
> I have table MASS_PERSONS which has foreign key to MASSGROUPS table.(GR_ID) REFERENCES MASSGROUPS(ID) ON UPDATE CASCADE ON DELETE
> ALTER TABLE MASS_PERSONS_LV ADD CONSTRAINT FK_MASSPERS FOREIGN KEY
>similar foreign key, but I get error "Object MASSGROUPS is in use".
> Now I wanted to add another table (MASS_PERSONS_LV) and create
> Is it not possible to have 2 tables, both having foreign key linkedto the same table?
No, there is not such a limitation, reason is simply we can't create
FK if server is'nt sure nobody work with "master" table at this
moment. If anybody (including your own connection) touched table
MASSGROUPS, it is in use. So, to create FK you should be a) sure you
alone is connected to database, including secondary connections from
your computer (from Delphi IDE etc) b) you did'nt touched master
table in statements within this connection. In practice when you
encounter this most simply way is to check condition a) and close your
connection, reconnect and repeat statement.
Best regards, Alexander.