Search code examples
databasefirebirdisql

Firebird copy from one database using isql


I've got 2 firebird databases

c:\db1.gdb
c:\db2.gdb

both databases schema's are the same so both contain a table

MyTable
-------
Id int
Name varchar(50)
...etc

Its guaranteed that the data is different on both databases, however I need to copy from db2.MyTable into db1.MyTable

A requirement is that I do this using the firebird isql tool.

How would I firstly using isql

-Connect to both db's in one isql command window
-run a sql statement that would do a select all from one table in db2 and insert it into the same table in db1

I'm using firebird 1.5


Solution

  • This is not possible with FB 1.5. You can do this with Firebird 2.5 using the new "execute statement...external" feature that makes it possible to access another firebird database from inside triggers, procedures and code blocks.