Subject Re: [firebird-support] Multidatabase query
Author Woody (TMW)
From: "Gustavo" <gusm@...>
>Hello:
>
>Suppose I have two databases named Database1 and Database2. In Database1
there is a >table named Table1 with fields Field11 and Field12 and in
Database2 there is a table >named Table2 with fields Field21 and Field22.
The question is:
>
>Is it possible to make a multidatabase query like the following?
>
>SELECT Table1.*, Table2.Field22
>FROM Database1.Table1, Database2.Table2
>WHERE (Table1.Field11 = Table2.Field21)
>
>I'm using Delphi 5 and IBX. I use the TQuery component but in its property
Database I can >assign only one database.
>
>If it´s impossible to do this with Firebird... Does anybody have any idea
of how can I obtain >my query in another way?

IMO, your best bet is to create a query returning the records you need from
the first database. Then, create a query on the second database using the
field from the first as a parameter to the second. Essentially, you get a
master-detail relationship so that as you move the pointer in the first, the
second responds correctly. I don't know if there are plans to incorporate
cross database joins in future versions of FB but it can't be done at the
moment.

HTH

Woody (TMW)