Step 5. Map the Input xml to the Target Database
LIC003 - Create a Transformation Map
You now have an input xml layout and target database tables in the mapping workspace. In this step you need to make known the connections between the input and target and to identify calculations and additional input.
1. Connect the TUTORDH file.
This connection specifies that an order header database record will be created for each <SalesOrder> element encountered in the input XML.
To make the connection, click and hold down the left-mouse button on the element, drag the mouse to the right, over the connector arrow adjacent to the TUTORDH file. As you drag the mouse, a connector line will be drawn. When the mouse is over the TUTORDH connector, the mouse pointer will change. Release the left mouse button to complete the connection.
2. Similarly, connect the TUTORDL file.
This connection specifies that an order detail database record will be created for each <Line> element encountered in the input XML.
3. Now connect the data items as follows:
4. The field Line Value LINVAL in table TUTORDL is to be derived by a calculation.
a. Add a multiply function from the
shown on the tab.
b. Set the inputs (
and ) as the and from the input order.c. Assign the result to the
field.
5. The field BCHNUM in the tables is a batch number. This does not exist in the input but will be provided to the Transformation Map at run-time via a parameter value.
a. To set up the mapping for this batch number, select
from the menu.
b. Set the
to and to .c. Give the batch number a default value of iii123. This will enable the
tab in MapForce to show a preview of the transformation.
6. Connect the resulting BCHNUM in tables TUTORDH and TUTORDL.
to the
7. You may click on the
tab to view how the data from the sample input would be added to the database tables. Note that, for the purpose of the preview, the field BCHNUM has the default value you gave it above. At execution time its value will come from a parameter value.8.
your map and exit from .