Top

8.6.3. Linking DB2 tables into OpenLink Virtuoso

  1. Start the Virtuoso Web User Interface

    Figure 8.273. Start

    Start

  2. Select the "Conductor" link in the Left Frame and Login as the "dba" user.

    Figure 8.274. Conductor

    Conductor

  3. Select the "Databases" -> "External Data Source" -> "Data Sources" tab menu items

    Figure 8.275. Databases

    Databases

  4. Select the "Connect" button for the "db2v8ma" DB2 DSN.

    Figure 8.276. Connect

    Connect

  5. On successful connection Select the "Link Objects" button to obtain a list of available tables

    Figure 8.277. Link Objects

    Link Objects

  6. Select the tables that you would like to link.

    Figure 8.278. Select tables

    Select tables

  7. Change the Catalog for each table to be "SAMPLE" using the "Set All" button.

    Figure 8.279. Catalog

    Catalog

  8. All the catalog names are changed to be "SAMPLE".

    Figure 8.280. catalog names

    catalog names

  9. Select the "Link" button to link the selected tables into Virtuoso

    Figure 8.281. "Link" button

    "Link" button

  10. On completion of the Link process the tables will be displayed in the "External Linked Objects" tab.

    Figure 8.282. Completion

    Completion

  11. The linked tables can be queried by clicking on the hyperlink in the Local Name column of the External Linked Objects tab above. This loads the Virtuoso Interactive SQL interface with the required SQL Select for retrieving the remote table data . We shall use the SAMPLE.db2v8ma.EMPLOYEE table to demonstrate this.

    Figure 8.283. view tables

    view tables

  12. Click the Execute button to run the query and retrieve the results from the remote table.

    Figure 8.284. Execute

    Execute

  13. The tables can also be viewed as part of the Virtuoso SQL Schema Objects under the SAMPLE catalog name.

    Figure 8.285. SQL Schema Objects

    SQL Schema Objects

    The Link process is now complete enabling the tables to be queried as if part of the Virtuoso Schema.