Subject RE: [firebird-support] Re: FK violation in FB 1.5
Author Bob Murdoch
Tom,

Thank you for the reply.

However, there do not seem to be any incorrect values in the DB, as
evidenced by the fact that I can drop the FK and recreate it. If
there were any bad values, I would receive an error when recreating
the FK.

Bob M..

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of tomkrej
Sent: Monday, January 19, 2009 10:36 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Re: FK violation in FB 1.5

Hi,
You have to correct values in database.

You can select all error rows in table TRUCK

e.g.

select * from TRUCK where (select CARRIER_ID from CARRIER where
CARRIER.CARRIER_ID = TRUCK.CARRIER_ID) is null;

correct them - set NULL, or some default value

then do backup/restore cycle

Tom


------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links