ODBC Connector 24.2

# Configure the Connector

This section describes how to configure the connector to extract data from multiple tables using a JOIN command in your SQL statement.

To extract data from multiple tables using a SQL JOIN

1. Stop the connector.

2. Open the ODBC Connector configuration file, and find the `[FetchTasks]` section.

       [FetchTasks]
       Number=1
       0=ExampleDatabase

       [ExampleDatabase]
       ConnectionString=...
       SQL=select * from orders
       PrimaryKeys=OrderID
       Template=template.tmpl
       SubTables=Customers

       [Customers]
       Template=customers.tmpl
       SQL=select * from Customers where CustomerID=@CustomerID

3. Modify the `SubTables` parameter so that it references a new section in the configuration file:

       SubTables=Customers,ItemDetails

4. Create a new section in the configuration file, using the name you specified in the `SubTables` parameter. In the new section, specify the following parameters:

   `Template` | The path to a template file. The template file defines how the data is indexed into IDOL Server.
   `SQL` | A SQL statement to retrieve the information from the sub-tables. This example uses a JOIN command to extract data from both the `Items` and the `Products` tables.

   For example:

       [ItemDetails]
       Template=items.tmpl
       SQL=SELECT * FROM Items INNER JOIN Products ON products.productID = items.productID WHERE orderID=@orderID

   NOTE: The connector runs this query for every row returned by the main query (`select * from orders`). When the connector runs the query, it automatically replaces `@orderID` with the OrderID retrieved from the main table (`orders`).

Copyright 2024 Open Text
Version 24.2 | Last updated March 2024

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: IDOL ODBC Connector 24.2

Topic Title: Configure the Connector