Mapping source and target columns automatically

You can customize how you want to map source and target columns.

About this task

For example, you may have wanted to map a particular target column to a source column, but because the column names did not match, the Map Tables wizard did not map them as you wanted. The Map Tables wizard cannot map a source column such as LOC to the target column LOCATION. Instead, you can map columns using a different mapping mode based on criteria such as ordinal position.

Procedure

  1. Click Configuration > Subscriptions.
  2. Select the subscription.
  3. Click the Table Mappings view and select the table mapping from the Source Table column.
  4. Right-click and select Open Details....
  5. Click the Column Mappings tab.
  6. Click Auto Map.
  7. Select one of the following mapping modes:
    Original mapping
    Maps columns based on changes made on the Column Mapping tab before you opened the Map Columns Automatically dialog box.
    Ordinal position
    Maps columns based on the order of columns in the source and target tables. The first column in the target table is mapped to the first column in the source table, the second column in the target table is mapped to the second column in the source table, and so on. If the number of columns in the target table is greater than the number of the columns in the source table, then initial values are used for trailing columns in the target table. If the number of columns in the source table is greater than the number of columns in the target table, then trailing columns in the source table remain unmapped. You can only map by ordinal position provided the data types are compatible.
    Name to name
    Maps columns based on matching column names. For example, if a column in the source table is called EMPNAME, then this column is automatically mapped to the column in the target table called EMPNAME.
    Name to description
    Maps columns based on matching target column names in source column descriptions. This is useful when you are working on an IBM® i database platform and you need to map the source table names to target columns.
  8. Click OK.
  9. Click Save.

Results

You should see your target columns mapped in the mode you selected on the Column Mappings tab.

When you start replication on the subscription, CDC Replication populates the target columns using the mapping mode you set.