Apply a Table Map

Use the APPLY command to overlay all or part of the Table Map editor with specifications from another Table Map. When the source table names in the applied Table Map match the source table names displayed in the Table Map editor, corresponding destination or Source 2 table names and any Column Map entries are copied to the Table Map editor. APPLY also transfers data destination associations for source Legacy Tables if an association is not already specified.

APPLY is useful to create a new Table Map from several existing Table Maps or to create a Table Map that is modeled on an existing or independently defined Table Map. For example, a “master” Table Map can establish default table mapping for a common pool of tables. A user can apply and edit the master Table Map for any process (even though processes do not involve the same set of tables) to obtain consistent mapping with a minimum of effort.

By default, the Destination or Source 2 Creator ID and table names are replaced when names of source tables match exactly (both table names must be qualified or not qualified). Other entries in the Table Map editor remain. Operands for the APPLY command allow you to:

  • Clear Dest CID and Destination Table Name before applying the Table Map.
  • Limit applied entries to the blank portions of the Table Map editor.
  • Limit the application to table names, Column Map names, Destination or Source 2 names, or all.

For example, to apply the Column Map entries from a Table Map named SMITH.TMAP, enter:


APPLY ADD COLMAPS SMITH.TMAP

A Column Map name from the Table Map SMITH.TMAP is inserted in blank Column Map portions when the source table is the same for both Table Maps. Irrelevant Column Maps defined in SMITH.TMAP are ignored. Any Column Maps named on the currently displayed Table Map are retained.

Selection List for APPLY

Use DB2 LIKE syntax with the APPLY command to display a selection list of Table Maps. For example, APPLY SMITH.% generates a selection list of all Table Maps that have the Map ID SMITH; APPLY%.TMAPS generates a list of Table Maps named TMAPS for all Map IDs; and APPLY with no operands generates a selection list of all available Table Maps.