community.borland.com

Article #25170: InterBase to InterBase - Cross database Table-data copy using QLI.exe

Problem:
How to implement Cross database Table-data copy
using QLI.exe

Solution:
Use QLI move the data to and from the the two databases 
in question to avoid the BDE and the problems associated
 with the DataPump or external files.

NOTE:	
Semicolons are optional in QLI unless you ask that they be required. 
QLI uses a logic for command continuation that assumes that end of line 
is end of command unless the command is obviously incomplete.

Scenario 1:
	Table in Database A (containg data)

	Table source (f1 CHAR(10),
		f2 CHAR(20),
		f3 CHAR(200))

	Table in Database B (empty)

	Table target (f1 CHAR(10),
    		f2 CHAR(20),
    		f3 CHAR(200))

Example:
This will move all the records from database A, table "source" into 
database B, table "target".  

NOTE:
Both table "source" and table "target" must exist prior to the
operation.

		at prompt	C:>qli
		QLI> ready database A as source_db;
		QLI> ready database B as target_db;
		QLI> target_db.target = source_db.source;
		QLI> commit;

Scenario 2:
		Table in Database A (containg data)

		Table source (f1 CHAR(10),
			f2 CHAR(20),
			f3 CHAR(200))

The "target" table in Database B does not exist at this point.

Example:
This will both create the "target" table in database B as well as
populate it with the data from database A.

		at prompt	C:>qli
		QLI> ready database A as source_db;
				QLI> ready database B as target_db;
				QLI> create relation target_db.target based on source_db.source;

Last Modified: 29-SEP-00