Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TWO DBIs ONE SQL Statement...Possible?

Status
Not open for further replies.

CherylD

Programmer
May 1, 2001
107
CA
I am wondering if anyone here has ever had the instance of using 2 diffent DBIs, one connects to a Postgres table and one to a SQL 2000, but has written one sql statement.

I am interested in joining the 2 different tables in a sql statement. Now I can still manage to do what I want, but selecting from the first table (psql) and while looping throught the recordset selecting what I need from the second table (sql2000). But it would be neat if I could join the two as long as I stick to common sql commands that both platforms can use.

Sample:
SELECT PSQLT1.ITEM1, SQLT1.ITEM1
FROM PSQLT1 INNER JOIN SQLT1 ON PSQLT1.ID = SQLT1.ID


Anyone have any ideas or thoughts of this?
 
CherylD,
As far as I know what you are asking is impossible. The reason is that the join is done by the database server. The only way I could see this working is if one of the databases could see the other and do joins with the foreign tables. I know postgres can't do this, but if M$ can you might be able to go that way with the foreign tables in postgres.
 
I would agree with usige, I don't know of a way to join tables from different database handles - I would do it as usige suggests as even if you found a module to do the job it would be very inefficient.

Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top