Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Mixing local and remote databases in a query
Tue, Jul 29 2008 6:49 AMPermanent Link

Leslie
Tim,

I would like to do some selection on the remote side and then join the rest of the tables
locally.  How is a query executed when it contains a mix of local and remote database tables?

Leslie  
Tue, Jul 29 2008 11:33 AMPermanent Link

Leslie
Well, this is not possible at all, right? Smile
Tue, Jul 29 2008 12:06 PMPermanent Link

"Eduardo [HPro]"
Leslie

> I would like to do some selection on the remote side and then join the
> rest of the tables
> locally.  How is a query executed when it contains a mix of local and
> remote database tables?
You can´t mix local and remote databases.

One solution to this could be transfer local to remote or remote to local
and execute the selection in the appropriate place.

Eduardo

Tue, Jul 29 2008 12:50 PMPermanent Link

Leslie
Eduardo

You mean something like this?  

insert into LocalDB.SomeClients
 Select * from RemoteDB.AllClients
    where [filter condition];

Select * from  LocalDB.SomeClients
 Join LocalDB. ....


Leslie
Tue, Jul 29 2008 2:05 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Leslie


I don't think that will work. I may be wrong but I don't think you're allowed to cross session boundaries. What about using the replication features? If not you'll have to (I think) generate a temporary table on the server side, stream that across to the local machine and proceed from there.

Roy Lambert [Team Elevate]
Tue, Jul 29 2008 5:22 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Leslie,

<< I would like to do some selection on the remote side and then join the
rest of the tables locally.  How is a query executed when it contains a mix
of local and remote database tables? >>

It isn't. Smiley As Roy indicated, you can't cross session boundaries within a
single query.

The alternative is to stream the result set to a local table (can be a
temporary table) using SaveToStream/LoadFromStream, and then issue the query
locally.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Jul 30 2008 5:37 AMPermanent Link

Leslie
Tim & Roy,

Thank you!

Leslie
Image