Subject | Re: [firebird-support] Activate / Inactivate foreign keys? |
---|---|
Author | Milan Babuskov |
Post date | 2005-10-13T15:20:48Z |
Sándor Tamás (HostWare Kft.) wrote:
order of tables for deletion: just reverse the one it's using for
copying, and you'll have the correct order. Please note that it does not
support self-referencing tables though.
Running a bunch of ALTER TABLE ADD FOREIGN KEY statements should do the
job. It isn't much complicated to write a tool that would use the info
from system tables to drop all FKs and recreate them later. Which
programming language do you use to access Firebird?
--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org
> I wonder if ther is any possibility to turn foreign keys on / off, like aYou can DROP them first, and ADD them later.
> trigger, or something like this.
> It is because we have an archiver SP, which deletes dozens of records (ifThere are ways for this. For example you could use FBCopy to get the
> not thousands), and there are dependencies we have to manage.
order of tables for deletion: just reverse the one it's using for
copying, and you'll have the correct order. Please note that it does not
support self-referencing tables though.
> So to makeFull database update? What's that?
> things simple, we delete foreign keys, then make that deletion. After that,
> we have to make a full database update to restore those foreign keys.
Running a bunch of ALTER TABLE ADD FOREIGN KEY statements should do the
job. It isn't much complicated to write a tool that would use the info
from system tables to drop all FKs and recreate them later. Which
programming language do you use to access Firebird?
--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org