on 2014 Mar 25 11:08 AM
I want to use forward statement as sub-query but obviously it fails.
what is the best way to handle this? both servers are sybase IQ.
select * from table1 a join ( FORWARD TO server2 { sql-statement } ) as b on a.id = b.id
Thanks
Note
The FORWARD TO statement is a server directive and cannot be used in stored procedures, triggers, events, or batches.
It is used to send a complete SQL statement (or several ones) to a remote server. Therefore, you cannot use it as part of a query.
However, what you are trying to do can be done with proxy tables - they are "linked remote tables" that can be used within queries with local tables - though there are some performance implications.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can it at least insert the result of query from server2 to a temp table? and then join to temp table?
I try to avoid proxy table. Basically, we have two sybase IQ servers which have same db schema and should have the same data in some tables. We want to compare data easily and make sure server2 has all the data. I want to left outer join server2 result to check if any data is missing on server2. I don't want to create too many proxy tables just for this.
Then you may have a look at that question:
User | Count |
---|---|
81 | |
11 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.