Subject Re: [IBO] multiple databases
Author Svein Erling Tysvær
Unfortunately, I think the answer to your question is no, separate
databases cannot be joined within a query. I think the BDE was capable of
doing something like it, but not on the server.

The ability for TIB_Transaction to have several connections, means that you
can ensure changes are done to several databases (important if you e.g.
transfer money). If you want data for several databases to show up in the
same grid, I recommend that you follow the advise from Jason for another
message this weekend:

"Maybe, what I think you will need to do is use a CalculatedFields entry and
then use a Lookup() call in another dataset to supply the values. This will
be slightly slower but it should be well within acceptable range because
calculated fields are buffered and rather efficient about only recalcing
when necessary.

Let us know how it goes for you.

PS. Be sure to use the ARow.ByName() and not FieldByName() in the OnCalc
event."

I hope Helen or someone will tell me that I was wrong when I said that
separate databases cannot be joined in a query, but I think I've read it
from this list before.

Set

At 11:04 15.01.2001 +0100, you wrote:
>Hi all,
>
>I read about Interbase's ability to attach to multiple databases within a
>single transaction context, using two-phase commits etc. I can see that
>TIB_Transaction has properties IB_Connection1, IB_Connection2 and I assume
>they are there for this purpose.
>My question follows: Can I join tables from multiple databases?
>TIB_Statement has only one IB_Connection property. Is there a syntax for
>qualifying table names with database names in a SELECT ... JOIN statement?
>The Embedded SQL Guide shows such syntax by prefixing tablenames with
>database handles previously declared with a SET DATABASE. Is something like
>this also possible in TIB_Query or another IBO data access component?
>
>I guess I could use a datasource to create a master-detail link but I
>presume that a join performed on the server (I'm thinking about two
>databases on a single server) would be much more effective.
>
>Thanks in advance for your ideas.
>TOndrej
>
>
>
>