Syntax for heterogeneous queries 
Author Message
 Syntax for heterogeneous queries

What syntax do I need to use to do a heterogeneous query? Help
documentation says the following will work:

SELECT CUSTOMER.CUSTNO, ORDRS.ORDERNO
FROM :Oracle1:CUSTOMER, :Sybase1:ORDERS

...but when I substitute my local & server-based aliases, Delphi's query
editor chokes on the ":" as an invalid token. I'm also confused about
assigning a DatabaseName to the query. If I assign it the local alias,
the server-based tables aren't found.

Actually, I want to use SQL.Add statements to programmatically rebuild an
existing query. What syntax would I use???  (Thanks).




Sat, 05 Sep 1998 03:00:00 GMT  
 Syntax for heterogeneous queries

Quote:

> What syntax do I need to use to do a heterogeneous query? Help
> documentation says the following will work:
> SELECT CUSTOMER.CUSTNO, ORDRS.ORDERNO
> FROM :Oracle1:CUSTOMER, :Sybase1:ORDERS
> ...but when I substitute my local & server-based aliases, Delphi's query
> editor chokes on the ":" as an invalid token. I'm also confused about
> assigning a DatabaseName to the query. If I assign it the local alias,
> the server-based tables aren't found.

> Actually, I want to use SQL.Add statements to programmatically rebuild an
> existing query. What syntax would I use???  (Thanks).

I found the answer myself, but I wanted to post it in case anyone else ran into a similar
problem.

The trick is to surround the :ORACLE1:CUSTOMER (or whatever) with double quotes:

SQL.Add('SELECT CUSTOMER.CUSTNO, ORDRS.ORDERNO');
SQL.Add('FROM ":Oracle1:CUSTOMER", ":Sybase1:ORDERS"');

This seems to be working for me, and the DatabaseName works when assigned the local
alias.



Sun, 06 Sep 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Heterogeneous query

2. heterogeneous queries

3. Heterogeneous Queries

4. Heterogeneous Query - Sybase, Paradox HELP!!

5. heterogeneous query

6. Heterogeneous Database Queries in Delphi

7. Interbase and Heterogeneous Queries

8. Why don't heterogeneous queries work?

9. SQL Syntax Help with 3 Table Query

10. SQL query syntax using SUM and GROUP BY

11. Problem with ALIAS syntax in SQL query

12. Heterogeneous Services Agent

 

 
Powered by phpBB® Forum Software