Topic: How to disconnect all keys (FK, PK)?
How to disconnect all keys on tables (FK, PK), and after export-import to include them?
It is necessary here for what:
The user works with the program which uses basis Firebird. I have this program with basis (only the data in it old). The structure of my basis exchanges (I it I will finish, I will add labels, indexes...). And now the user should overload from the basis the data in my basis (an overload the program should do). The structure of tables on 99 % remains old, i.e. will be added two-three new labels, or any label on two (the part of fields remains in one, a part in another).
Tables in basis will be nearby 100-150, in labels - it is not a lot of data, approximately to 10000-20000 records.
I wanted to make so:
1. To be connected to the basis, to disconnect all keys (FK, PK)
2. To delete "almost" all (it and there are those labels identical on 99 % for both bases) the data (to delete a line from tables).
3. In a cycle to be transversed on "almost all labels and to copy a line from basis of the user in the basis.
4. Remained given (tables at which the structure exchanged) the program transfers on the algorithm put in it.
5. To make on generators in the basis - those values which at the user that primary keys were generated correctly further.
6. To include all keys (FK, PK)
While at shut-down FK of an index (the key is a link from a label dataful, on a label - the reference manual) faced an error:
This operation is not defined for system tables.
unsuccessful metadata update.
ALTER INDEX @1 failed.
action cancelled by trigger (@1) to preserve data integrity.
Cannot deactivate index used by an integrity constraint.