Nesting columns to join data using the %GETCOL function (DB2® for i)

An example of how to nest columns to join data using the %GETCOL function and the CDC Replication Engine for Db2® for i.

This example uses the relationship between primary and secondary tables. In this example, you will consolidate data from secondary tables without replicating the secondary tables.

To use this example, perform the following steps:
  1. Add a derived column, CTNAME, based on the NAME column, to the COUNTRY table.
  2. Enter the following expression for the CTNAME column: %GETCOL(NAME, PRODLIB/COUNTRY, , , 1, %GETCOL(COUNTRY, PRODLIB/STATE, , , 1, STATE))

    This function retrieves the NAME column from the COUNTRY table using the STATE column from the EMPLOYEE table and the COUNTRY column from the STATE table.