Subject | CASCADE option in FK declaration doesn't work - after some time |
---|---|
Author | |
Post date | 2013-12-11T11:22:18Z |
Hi, I'm using - ON UPDATE CASCADE, or ON DELETE CASCADE options in FK declarations - when I create the FK it works - but sometimes - after backup/restore or some undefined time - I don't know - it doesn't work.
I'm using FB 2.5.2 64b on windows server 2008 R2
Example - today I wanted to change the key in primary table, but It raises an error
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544466. violation of FOREIGN KEY constraint "FK_DEF_LOK_TEMA_LOKACE" on table "DEF_LOK_TEMA"|Foreign key references are present for the record
so I have to Ctrl+C from DDL - ALTER TABLE DEF_LOK_TEMA ADD CONSTRAINT FK_DEF_LOK_TEMA_LOKACE FOREIGN KEY (FK_LOKACE) REFERENCES DEF_LOKACE (ID_LOKACE) ON DELETE CASCADE ON UPDATE CASCADE;
drop that FK
and recreate it using the same definition as there was.
And now I can change the recod - but I don't know how long it will work
It is not the first time I met this problem. Do you anybody know how make it work properly for all times?
I'm using FB 2.5.2 64b on windows server 2008 R2
Example - today I wanted to change the key in primary table, but It raises an error
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544466. violation of FOREIGN KEY constraint "FK_DEF_LOK_TEMA_LOKACE" on table "DEF_LOK_TEMA"|Foreign key references are present for the record
so I have to Ctrl+C from DDL - ALTER TABLE DEF_LOK_TEMA ADD CONSTRAINT FK_DEF_LOK_TEMA_LOKACE FOREIGN KEY (FK_LOKACE) REFERENCES DEF_LOKACE (ID_LOKACE) ON DELETE CASCADE ON UPDATE CASCADE;
drop that FK
and recreate it using the same definition as there was.
And now I can change the recod - but I don't know how long it will work
It is not the first time I met this problem. Do you anybody know how make it work properly for all times?