Retrieving a column from another table using the %GETCOL function (DB2® for i)
An example of how to retrieve a column from another table using the %GETCOL function and the CDC Replication Engine for Db2® for i.
This example uses the relationship between a primary (EMPLOYEE)
and secondary (BRANCH, STATE, and COUNTRY) tables.
In this example, you will retrieve the column NAME from the STATE
table using the STATE column from the EMPLOYEE table. To use this
example, perform the following steps:
- Add a derived column, STNAME, based on the NAME column, to the STATE table.
- Enter the following expression for the STNAME derived column:
%GETCOL(NAME,
PRODLIB/STATE
, , , 1, STATE)