Subject | Re: [firebird-support] I can't drop foreign key |
---|---|
Author | Mark Rotteveel |
Post date | 2016-02-17T08:12:24Z |
On 16-2-2016 22:05, watanove@... [firebird-support] wrote:
this constraint shouldn't be able to exist.
report the output?
If all else fails, you could also consider creating a new database, and
pumping over the data.
Mark
--
Mark Rotteveel
> I am using FireBird 2.5.3Interesting that this table doesn't appear to have a column PARTSID, so
> and a Database is updated from 2.2, and the database was updated from 1.5.
>
> The database have about 150 tables and just one foreign key.
>
> The Foreign key is from "hachu"Table to "parts"Table
>
> This is part of definition of the tables.
> ISQL display these informations.
>
> SQL> show table parts;
> OPERATIONCODE VARCHAR(100) Nullable
> PARTSID INTEGER Not Null
> PRODUCTCODE VARCHAR(100) Nullable
> CONSTRAINT INTEG_152:
> Primary key (PARTSID)
>
> SQL> show table hachu;
> HACHUDATE &n bsp; DATE Nullable
> HACHUID INTEGER Not Null
> HACHUNO VARCHAR(10) Nullable
> HSU INTEGER Nullable
> CONSTRAINT FKHACHUTOPARTS:
> Foreign key (PARTSID) References PARTS (PARTSID) On Delete Set Null
this constraint shouldn't be able to exist.
> I tried to drop the foreign key,but I could not.Do you have stored procedures referencing this table?
> SQL> alter table hachu drop constraint fkhachutoparts;
>
> Statement failed, SQLSTATE = 42000
> unsuccessful metadata update
> -cannot delete*-INDEX FKHACHUTOPARTS
> -there are 1 dependencies
>
> I deleted all records of "parts" and "hachu".
> I deleted all triggers of "parts" and "hachu".
>
> But "there are 1 dependencies"
> I can't also drop these tables.Could you run gifx -v -full -n <database-name> on your database and
>
> SQL> drop table hachu;
> Statement failed, SQLSTATE = 42000
> unsuccessful metadata update
> -cannot delete
> -INDEX FKHACHUTOPARTS
> -there are 1 dependencies
>
> SQL> drop table parts;
> Statement failed, SQLSTATE = 42000
> unsuccessful metadata update
> -ERASE RDB$RELATION_CONSTRAINTS failed
> -action cancelled by trigger (1) to preserve data integrity
> -Cannot delete PRIMARY KEY being used in FOREIGN KEY definition.
>
> I don't understand why i can't drop the foreign key.
> But i want to drop the foreign key.
report the output?
If all else fails, you could also consider creating a new database, and
pumping over the data.
Mark
--
Mark Rotteveel