The Flexible Target Key Custom transformation has been developed to address the case where a data target has its Primary Key mapped to a column in a PowerExchange Change Data Capture source, which may be subject to update.
Prior to the implementation of the Flexible Target Key facility, the only way to identify these changes to a key field was to pass the full record before and after image in the change stream. For sessions involving large amounts of data this overhead could be significant.
For those wishing to keep network traffic to a minimum, PowerExchange has been enhanced to allow indicators to be added to specific fields. These indicators identify instances where that field has changed, and comprise both a “before image” field and a “change indicator” for any given field. From this information a delete/insert pair can then be generated for the target.
The following figure shows the process:
COL1 is updated from an A to a C. The PowerExchange Listener sends a before-image column value of A and an after-image column value of C to PowerCenter. Because COL1 is marked as the primary key for the target table, the Flexible Target Key transformation processes the update as a delete of row A and an insert of row C.