Subject Re: [Firebird-Java] Re: How to turn referential integrity checking off
Author Roman Rokytskyy
> The problems result during the creation of the tables themselves. If a
> 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.

That is right... Now all pieces are together in my head :)

> I have already constructed parts of the SQL statements with the help
> of those methods.

If you code is generic enough, would you please consider to publish it on
our Wiki, so others can use it too?

> I have got the idea to construct such ALTER statements, ignore
> initially the REFERENCES parts when creating the tables,

If you can strip the REFERENCES clauses from the original script, then half
of the job is already done :)

> 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.

Also, I think that is the only portable approach for other databases.

Roman