The Mapping tab from a Data transfer action properties screen lets you view or specify how source data is transformed into the target data source during a data transfer action (DTA). Mappings determine the relation between source and target by setting up relations between their entities and fields (tables and columns). Within the system mappings correspond to calculations for every target field that specifies how the data is created during a data transfer. However in using the system you do not require an in-depth knowledge of the structure of these data sources or the calculations defining a mapping. Mappings can be created simply by dragging across the screen. More complex relations and filtering can be created by using the system Calculator if required, which again can build up calculations by dragging and dropping. Note that it is often quicker to copy and alter an existing data source and change mapping relations rather than to define a new data source from scratch. Here is an illustration of a Mapping screen:
To create a new mapping or alter an existing one: the goal of this screen is to create calculations that determine how the data is created for each target field during a data transfer, i.e. the mapping is created by showing how data in the source is to be transformed into the target data source. The left-hand tree on the Mapping window contains the source data tables and columns while the right-hand tree contains the entities and fields of the target data source definition. As usual expand the entities to see constituent fields. If you are viewing an existing mapping you will see the calculations defining it next to target fields. You have the option to include data in the target data source that does not come from the data sources and to include complex calculations using the in built Calculator, accessed by pressing the button at the bottom right of the screen, see Calculator overview for more. See Example JDBC mapping and for detailed discussion of an example.
To create a field-mapping: The simplest mapping calculations are field mappings which specify that the data for a target data source field comes directly from a source data source field. Simply click on the source field in the left-hand tree and drag that field to the appropriate target field in the right-hand tree, then drop the field. A calculation will be automatically created. A field-mapping calculation takes the form:
return {[source entity name]..[source field name]}
The keyword after return in this simple calculation, is the script definition of the data to be put into the target data field.
To create more complex calculations: As you select the target field in the right-hand tree you will see that the calculation appears in the Calculation text area at the bottom of the screen. Click into the calculation to edit it by hand or else you can press the Calculator button to use the in-built scripting, see Calculator overview or Calculator properties for details and links to other help topics. You can also use the Select/Update icon to update selected fields in a target database, see Select/Update criteria for more.
To clear a calculation from a target field first select the target field in the Mapping screen then press the Clear Calc icon in the Mapping toolbar. The calculation will be removed.
To control how a database is updated: including which data is selected in the source and which data in the target is updated use the Select/Update icon in the Mapping toolbar or choose this option from the right-click menu, see Select/Update criteria.
Grouping target fields can prevent duplicate entities in the target data source, see Grouping calculations for more.
Collapse All / Expand All use the toolbar icons or the corresponding right-click menu for a shortcut way to expand every entity in the source and target data sources, in the Mapping window. This has the same effect as pressing + throughout both panes.
Related topics include Data transfers overview, Data transfer properties, Data source overview, Calculator properties, Grouping calculations, Example JDBC mapping