Combining columns using the %GETCOL function (DB2® for i)

An example of how to combine columns 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 combine the STATE and COUNTRY columns from the STATE table using the %CONCAT function. To use this example, perform the following steps:
  1. Add a derived column, REGION, based on the STATE and COUNTRY columns in the STATE table.
  2. Enter the following expression for the REGION column: %CONCAT(%GETCOL(STATE, PRODLIB/STATE, FAILED, , 1, STATE), -, %GETCOL(COUNTRY, PRODLIB/STATE, FAILED))

    The second %GETCOL function retrieves the COUNTRY column from the STATE table. This column was retrieved in a previous %GETCOL function invocation.