Mapping accumulation and deduction expressions to a target column

If you have mapped your tables using Summarization in the Map Tables wizard, then you can map accumulation or deduction expressions to a target column. When you map tables for summarization, the target table is largely a repository of numerical data increments or decrements in response to source row-level operations transferred by refresh or mirroring activity.

About this task

For example, if you have a target column such as REVENUE and you want the value in this column to increment each time a product gets sold in the SALESAMOUNT source column, then you can map SALESAMOUNT to REVENUE. Drag and drop the source column from the list next to the target column to which you want to map.

When you are mapping expressions to target columns, keep in mind that many databases have column name length limitations, which can affect how some expressions, user exits, and derived columns are handled. Column name length limitations can cause CDC Replication to describe a column alias to the target when the source column name length exceeds the column name length limit on the target. The restriction is 30 characters for most CDC Replication compatible databases (IBM® DB2® for Linux, UNIX, and Windows and Oracle). Microsoft SQL Server has a limit of 128 characters.

Procedure

  1. Click Configuration > Subscriptions.
  2. Select the subscription.
  3. Click the Table Mappings view and select the table mapped for Summarization
  4. Right-click and select Open Details....
  5. Click the Column Mappings tab.
  6. Depending on which source columns you want to summarize data, map your source columns to target columns.
  7. Expand the Summarization list and drag and drop either Accumulation or Deduction expressions on the source and target column mapping.

    You can also build an expression that summarizes data.

  8. Select the source column and click OK.

    Depending on how you want to summarize data, the source column in the list updates with a plus or minus sign.

  9. Click Save.

Results

When you start replication on the subscription, CDC Replication accumulates or deducts the summarized data in response to row-level operations occurring on the source table.