Open topic with navigation

# SubTables

The `SubTables` parameter specifies a comma-separated list of sub tables that contain data linked to the main table. These tables require a separate section in the configuration file detailing how they should be used. For example:

    [MyTask]
    ConnectionString=...
    PrimaryKeys=item_id
    Template=inventory.tmpl
    SQL=select * from inventory
    Subtables=flow

    [flow]
    template=flow.tmpl
    SQL=select * from inventory_flow where item_id = @item_id

In the preceding example, the table `flow` is linked to the main table (`inventory`). The table `flow` has a separate SQL statement that is run for every row returned from the main table. The table also has its own template file, which is merged with the main template. For more information about constructing templates, refer to the ODBC Connector Administration Guide.

The tables are linked by the `item_id` column. In the SQL statement for the `flow` table, the connector replaces `@item_id` with the `item_id` returned from the `inventory` table. (The connector replaces any items in the SQL statement marked with `@` with the value from the main table).

If the main query returned rows with the `item_id` column ranging from 1-10, the connector would run another query for each row. The first would be:

    select * from inventory_flow where item_id = 1

and the second would be:

    select * from inventory_flow where item_id = 2

and so on.

Type: | String
Default: |
Required: | No
Configuration Section: | TaskName or FetchTasks
Example: | `Subtables=Table1,Table2`
See Also: | SQL Template

© Copyright 2018 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm