Subject | Re: How to turn referential integrity checking off |
---|---|
Author | pifproject |
Post date | 2005-10-01T21:10:42Z |
Hello Roman,
thank you very much indeed again for your helpful replies!
CREATE TABLE statement has a "REFERENCES 'primaryKeyTableName'
('primaryKeyTableColumn')" clause and that 'primaryKeyTable' has not
been created yet, such a CREATE TABLE statement will cause an error
because both the referenced table and its respective column cannot be
found in the target database at that time. I first create a table,
then populate it (write data into that created table), afterwards
create another table and populate it and so on until there are tables
to write to the database and data for the tables to populate them with.
of those methods.
initially the REFERENCES parts when creating the tables, then execute
these ALTER statements when all tables have already been created and
their data written in the target database. This may well solve my
problem in a optimal way.
thank you very much indeed again for your helpful replies!
>> My purpose is to find a way to populate a target FirebirdThe problems result during the creation of the tables themselves. If a
>> database without having problems with referenced tables
>> that still do not exist (because they're not written
>> to the database at that point in time).
>
> I think you mean that data in the tables do not exist, not
> the tables themselves. Right?
CREATE TABLE statement has a "REFERENCES 'primaryKeyTableName'
('primaryKeyTableColumn')" clause and that 'primaryKeyTable' has not
been created yet, such a CREATE TABLE statement will cause an error
because both the referenced table and its respective column cannot be
found in the target database at that time. I first create a table,
then populate it (write data into that created table), afterwards
create another table and populate it and so on until there are tables
to write to the database and data for the tables to populate them with.
> this functionality does not exist, as well as the deferredI have already constructed parts of the SQL statements with the help
> constraint checking. You can walk through all tables, get
> their constraints with DatabaseMetaData call (getImportedKeys
> and getExportedKeys), store somewhere, and at the end construct
> appropriate SQL statements.
of those methods.
> When gbak creates a backup file, it stores the constraintsI have got the idea to construct such ALTER statements, ignore
> separately as ALTER TABLE ... ADD CONSTRAINT statements
initially the REFERENCES parts when creating the tables, then execute
these ALTER statements when all tables have already been created and
their data written in the target database. This may well solve my
problem in a optimal way.