Heterogeneous joins

<< Click to Display Table of Contents >>

Navigation:  Local SQL > Data Manipulation Language > Relational operators >

Heterogeneous joins

Previous pageReturn to chapter overviewNext page
hmtoggle_plus1See also

Joins two tables from different databases.

SELECT column_list

FROM ":database_reference:table_reference", ":database_reference:table_reference" [,":database_reference:table_reference"...]

WHERE predicate [AND predicate...]

Description

Use a heterogeneous join to join two tables that reside in different databases. The joined tables may be of different types (like dBASE to Paradox or Paradox to InterBase), but you can only join tables whose database types are accessible through the BDE (local, ODBC, or SQL Links). A hetergeneous join may be any of the joins supported by local SQL. The difference is in the syntax for the table reference: the database containing each table is specified in the table reference, surrounded by colons and the whole reference enclosed in quotation marks. The database specified as part of the table reference may be a drive and directory reference (for local tables) or a BDE alias.

SELECT *

FROM ":DBDEMOS:Customer.db" C, ":BCDEMOS:Orders.db" O

WHERE (C.CustNo = O.CustNo)