Subject | Re: [ib-support] Creating Foreign keys |
---|---|
Author | Martijn Tonies |
Post date | 2003-04-25T13:38:17Z |
> I have table MASS_PERSONS which has foreign key to MASSGROUPS table.REFERENCES MASSGROUPS(ID) ON UPDATE CASCADE ON DELETE
> ALTER TABLE MASS_PERSONS_LV ADD CONSTRAINT FK_MASSPERS FOREIGN KEY (GR_ID)
>foreign key, but I get error "Object MASSGROUPS is in use".
> Now I wanted to add another table (MASS_PERSONS_LV) and create similar
> Is it not possible to have 2 tables, both having foreign key linked to thesame table?
>No COMMIT? Hmmm ... that means the table MASS_PERSONS_LV
>
> CREATE TABLE MASS_PERSONS_LV (
> GR_ID INTEGER NOT NULL,
> NAME VARCHAR(30) CHARACTER SET WIN1252,
> ACCOUNT VARCHAR(16) CHARACTER SET WIN1252,
> REGNO VARCHAR(15) CHARACTER SET WIN1252,
> BANK VARCHAR(12) CHARACTER SET WIN1252,
> AMOUNT NUMERIC(15,2)
> );
isn't really existing yet ... Sounds like a good reason why the ALTER fails
:)
> ALTER TABLE MASS_PERSONS_LV ADD CONSTRAINT FK_MASSPERS_LV FOREIGN KEY(GR_ID) REFERENCES MASSGROUPS(ID) ON UPDATE CASCADE ON DELETE CASCADE;
>With regards,
>
Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com
See you at the First European Firebird Conference in May in Fulda, Germany
http://www.firebird-conference.com