Configuring Mappings with Flexible Target Key Transformations
Configuring Mappings with Flexible Target Key Transformations
The PowerExchange Change Data Capture (CDC) source will now need to be imported. This must be done through the Import from PowerExchange option under Source Analyzer in the PowerCenter Designer.
After the CDC source has been imported, the target definitions will be required. Import them in the Target Designer in the PowerCenter Designer.
The following figure shows an example structure of a source CDC table that works with a DB2 data capture source and a DB2 target table:
The columns prefixed DTL_CI and DTL_BI are the change indicator and before image, respectively. These columns are necessary for this flexible transformation. The DTL__CAPX columns are PowerExchange capture columns.
The following figure shows the structure of the target DB2 table:
The source table has a primary key of CUSTOMER_ID, and the PARTNER_CUST_ID is an attribute of the table. The transformation will load the data into the target table where the PARTNER_CUST_ID is the primary key, and the CUSTOMER_ID is an attribute of that table.
In this case, if the PARTNER_CUST_ID changes in the source table, a delete and insert will be required for the target.
Drag the PowerExchange CDC source, and the target into the mapping.
Any of the control information including BI and CI columns could, if required, be defined in the target definition.
To configure a mapping with a Flexible Target Key transformations:
From the
Transformation
option, select
Create
.
Select a transformation type of
Flexible Target Key
and click
Create
.
The transformation is inserted into the mapping.
Link into the transformation the required columns from the source for the target.
Also, the transformation will require the BI and CI indicators that were assigned earlier in PowerExchange. A final column DTL__CAPXACTION should also be added to the transformation.
The BI and CI columns need to be linked to the Flexible transformation.
Right-click the transformation you have just created. Select
Edit,
and then select the
Source Column Map
tab.
Add the columns to which the relevant before images and change indicators are assigned.
Multiple columns can be added here when the target primary key demands.
Link the transformation to the target.
Only link the required data columns from the transformation to the target. No links will exist from the transformation to the target for the CI and BI columns, nor for the DTL__CAPXACTION column unless required in the target.