Subject Re: [firebird-support] Automate transfer data from one database structure to another
Author Ann W. Harrison
Namit Nathwani wrote:
>
>>I'd use QLI and the following set of commands:

now with annotation
>>
>>qli> ready old_database.fdb as source

connect to the original database, giving it the alias 'source'.

>>qli> ready new_database.fdb as target

connect to the new database giving it the alias 'target'.

>>qli> for x in target.rdb$relations with x.rdb$system_flag = 0 or
>>con> x.rdb$system_flag is null
>>con> begin
>>con> print "target."||x.rdb$relation_name || " = source." ||
>>con> rdb$relation_name on "foo.qli"

Build a command script from the list of tables in the target database
where each command line copies a user table from the source database to
the target database.

>>qli> @...

Invoke the generated script.


This works on dialect 1 databases.

And yes, you can put the commands in a script and execute it the same
way that the commands execute the script 'foo.qli'.


Regards


Ann