DataMigrator now allows you to build a single data flow that performs lookups into multiple tables using the DB_LOOKUP function without requiring explicit joins.
In the following example, DMORD is the primary source containing orders data, while DMCOMP and DMINV are the lookup sources. While DMORD contains store codes and product numbers, DMCOMP contains the store names for those store codes, and DMINV contains the product names for each product code.
Refer to the sample data flow DMLKUPS for the complete example.
For more information on improving lookup performance, see Improving Lookup Performance.
This example uses the DB_LOOKUP function to create a source transformation.
The Source Transformations window opens.
The Transformation Calculator window opens.
The prototype for DB_LOOKUP appears in the Expression window and the Lookup window opens, as shown in following image.
The Select Synonym dialog box opens.
Note: If you have Automatically add join conditions checked in Tools/Options/Data Management, the Lookup is added automatically since both data sources have a column with the same name and format and that column is a key column in the lookup table.
When you have selected the columns, the Lookup window should appear as shown in following image.
The Lookup columns window opens, as shown in following image.
The Lookup window should appear as shown in following image.
The expression in completed in the Transformation Calculator window.
The Transformation Calculator should now appear as shown in the following image.
The STORENAME source transformation is added to the Source Transformations window.
Parameter |
Column Name |
---|---|
Lookup Synonym |
DMINV |
Source Column |
PROD_NUM |
Lookup Column |
PROD_NUM |
Return Value |
PRODNAME |
Column |
PRODNAME |
Format |
A30 |
When you are done, the Source Transformations window should appear as shown in following image.
The Column Selection window opens.
The Columns Selection window should appear as shown in following image.
The Select Statement window opens, as shown in following image. Note that there are no joins in the SQL statement.
The Test SQL Statement window opens, as shown in following image. Note that the answer set includes columns from DMCOMP (STORENAME), DMORD (PLANT, QUANTITY, LINEPRICE), and DMINV (PRODNAME). The sum of QUANTITY and LINEPRICE may vary depending on your database and your setting for Maximum number of rows for test reports in Tools/Options/Run Options.
When the data flow run is complete, verify that the data was loaded properly by right-clicking the DMXSTORES object, selecting Toggle, and clicking the Sample Data tab.
Note:
iWay Software |