|
|
|
|
|
Cross-database queries
 Not available with these kinds of connection
An SQL query can run on different server databases: HFSQL, Oracle, SQL Server, etc. You can join queries that fetch data from different databases. This means that data can be stored on different databases. You have the ability to extract and aggregate data from any source. This feature is very useful for managing existing Information Systems. To better understand the operating mode of the cross-database queries, let's look at a simple example: - On an Oracle database, the following query (named MyQry1) is run by HExecuteSQLQuery. This query is used to select the record numbers of the customers.
SELECT Customer.CUUniqueKey+10 AS CUUniqueKey10 FROM Customer - On an HFSQL database, the following query (named MyQry2) is run by HExecuteSQLQuery. This query is used to select the record numbers of the customers and their order number.
SELECT CUUNIQUEKEY,Orders.OrderNumber AS ORDERNUM FROM ORDERS - The cross-database query executed is as follows:
SELECT * FROM MyQry1,MyQry2
WHERE MyQry2.CUUniqueKey=MyQry1.CUUniqueKey10
AND (MyQry2.ORDERNUM = '37348' OR MyQry1.CUUniqueKey10=80) This query is run itself by HExecuteSQLQuery.
Note: Cross-database queries cannot be run with "SQL query" variables. It is necessary to use "Data Source" variables.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|