Subject Re: [firebird-support] Re: Attaching to more then one DB at a time
Author Ann W. Harrison
On 1/19/2011 3:54 AM, Svein Erling Tysvær wrote:
>
>
> Moreover, I think QLI can connect to several databases. QLI is an old InterBase tool with a strange syntax (I think QLI was made before SQL became a standard) that only a handful of people know how to use. For Windows, it is in the BIN folder, same place as gbak and gfix, don't know if or where it is for DBD.
>


Internally Firebird maintains database handles, creating
a hierarchy from connection to databases to transactions to
statements. When InterBase adapted to SQL the rule was that
we would implement only standard SQL and the standard did
not include the concept of multiple database. To be fair,
we didn't have the concept of multiple schemas, and a better
implementation would have mapped our databases into schema.

On the other hand, there is no internal plumbing for using
multiple databases in a single statement - you can't join
tables from different databases, so maybe the schema idea
would not have worked.

In QLI you would copy a table from one database to another
like this...

qli> ready <database name> as old
qli> ready <other database name> as new
qli> define relation new.table1 based on old.table1
qli> new.table1 = old.table1
qli> commit

And the commit would be two phase...


Cheers,

Ann