Subject Re: [firebird-support] Why I cannot remove FK constraint
Author Daniel Miller
On 1/25/2019 7:11 PM, Daniel Miller dmiller@... [firebird-support] wrote:
On 1/24/2019 7:56 AM, respektive@... [firebird-support] wrote:
Hello

I have problem with part of our databases.
All our databases should have the same structure, but in some of them I cannot drop constraint

ALTER TABLE VYKONY_AUT DROP CONSTRAINT FK_VYKONY_AUT_VYKON

chyba: java.sql.SQLSyntaxErrorException: unsuccessful metadata update; ERASE RDB$RELATION_CONSTRAINTS failed; action cancelled by trigger (1) to preserve data integrity; Cannot delete trigger used by a CHECK Constraint; At trigger 'RDB$TRIGGER_34' [SQLState:42000, ISC error code:335544351]
java.sql.SQLSyntaxErrorException: unsuccessful metadata update; ERASE RDB$RELATION_CONSTRAINTS failed; action cancelled by trigger (1) to preserve data integrity; Cannot delete trigger used by a CHECK Constraint; At trigger 'RDB$TRIGGER_34' [SQLState:42000, ISC error code:335544351]

Try this - see if either of these queries show you what might need to be fixed.  Otherwise you'll need to share your database structure:

    select * from RDB$RELATION_CONSTRAINTS where RDB$RELATION_NAME = 'VYKONY_AUT';

and

    select * from RDB$RELATION_CONSTRAINTS where RDB$RELATION_NAME = 'FK_VYKONY_AUT_VYKON';

--
Daniel