Board index » delphi » Query on multiples databases with Delphi 3

Query on multiples databases with Delphi 3

Hi,

Do you know how can I access multi-databases via SQL with Delphi 3 ?

As an exemple, I tried a query like :

select client.name from ":Interbase1:client",":Interbase2:order"
where client.code = order.code

I tried in executing in the DbExplorer but it doesn't work. And with a
TQuery component, I don't know how to use it because there is a property for
only one database.

If someone can help me it would be great.

Thanks for your help

-----------------------------
Cdric Joubert
c.joub...@timeless.fr
http://www.multimania.com/cjoubert
http://groupevinci.free.fr/

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 

Re:Query on multiples databases with Delphi 3


Try:

select client.name
from ":Interbase1:client" client,":Interbase2:order" order
where client.code = order.code

(for more information see Delphi OLH, topic 'Heterogeneous joins')

"Cdric Joubert" <joub...@cnam.fr> schreef in bericht
news:3a87fe02_1@corp.newsfeeds.com...

Quote
> Hi,

> Do you know how can I access multi-databases via SQL with Delphi 3 ?

> As an exemple, I tried a query like :

> select client.name from ":Interbase1:client",":Interbase2:order"
> where client.code = order.code

> I tried in executing in the DbExplorer but it doesn't work. And with a
> TQuery component, I don't know how to use it because there is a property
for
> only one database.

> If someone can help me it would be great.

> Thanks for your help

> -----------------------------
> Cdric Joubert
> c.joub...@timeless.fr
> http://www.multimania.com/cjoubert
> http://groupevinci.free.fr/

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

Re:Query on multiples databases with Delphi 3


You need to use a Paradox alias as the alias for execution of your SQL statement

the embedded alias names you have in your sql will then ask for login that is if
they are not already opened.  Works in both Database desktop and DBExplorer.
You can even do three different aliases if you want.  I do have one warning for
you though.  The BDE on heterogenous joins even when using no paradox tables but
executed from a paradox alias must comply to local SQL rules (that eliminates
some
functionality that would otherwise be present for you depending on your database
server)  also execution is slow I have always had the querys succeed but some of
them take forever depending on what you are doing (like on the order of hours).
I've started queries that I thought timed out and went home the next day I
returned
the result set was there(initially I had no patience and gave dbexplorer the 3
finger salute).  Incredibly the BDE seems to be able to complete literally all
of the heterogenous queries but is at times very very slow.  If you have a
native tool to do this I suggest you use it for speed or limit the number of
conditions or other parameters for speed sake.

Good Luck

Quote
"Cdric Joubert" wrote:
> Hi,

> Do you know how can I access multi-databases via SQL with Delphi 3 ?

> As an exemple, I tried a query like :

> select client.name from ":Interbase1:client",":Interbase2:order"
> where client.code = order.code

> I tried in executing in the DbExplorer but it doesn't work. And with a
> TQuery component, I don't know how to use it because there is a property for
> only one database.

> If someone can help me it would be great.

> Thanks for your help

> -----------------------------
> Cdric Joubert
> c.joub...@timeless.fr
> http://www.multimania.com/cjoubert
> http://groupevinci.free.fr/

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

Re:Query on multiples databases with Delphi 3


In article <3a87fe0...@corp.newsfeeds.com>, =?iso-8859-1?q?C=E9dric_Joubert?=
<joub...@cnam.fr> writes

Quote
>Do you know how can I access multi-databases via SQL with Delphi 3 ?

When I started using Delphi I knew nothing about SQL. To get going I used
the database desktop to create a query using DOS Paradox QBE which I
know well. I could then save as SQL and copy to my Delphi program. Now
I use this method for complex queries only. QBE is not diffficult even if you
haven't used it before.

Pat
--
Pat White
email: p...@pwhite.demon.co.uk
Phone; +44 (0)1925 266113

Other Threads