Beruflich Dokumente
Kultur Dokumente
com +917411642061
Lab
Dynamic Lookup
Lab at a Glance................................................................2 Objectives..............................................................2 Summary................................................................2 Duration.................................................................2 Exercises..........................................................................3 Exercise 1: Create the Mapping.............................3 Exercise 2: Create and Run the Workflow............12
8-1
Lab at a Glance
The exercises in this lab are designed to walk the student through the process of using a Lookup transformation.
Objectives
After completing the lab, the student will be able to use a Dynamic Lookup transformation.
Summary
The purpose of this lab is to load an ODS_EMPLOYEE table with records. The data will be extracted from the EMPLOYEE flat file. The target table ODS_EMPLOYEE table will be used as the lookup table. SOURCE: EMP TARGET: EMPLOYEE_TGT The completed mapping should look as follows:
Duration
This lab should take approximately 40 minutes.
8- 2
Exercises
Exercise 1: Create the Mapping
Step 1. Import the source table. Clear the Source Analyzer workspace (right-click anywhere in the workspace and select Clear All). Continue to work in the assigned student folder and import the EMP relational source table from the SDBU database schema. The source should look as follows:
Step 2. Import the target. Clear the Warehouse Designer workspace (right-click anywhere in the workspace and select Clear All). Import the EMPLOYEE_TGT relational database target table from the TDBUxx database schema. The target should look as follows:
8-3
Step 3. Creating a mapping. Create a mapping called m_EMP_TGT_DYNAMIC_LOOKUP. Step 4. Add source and target. Add the EMP source definition with its respective Source Qualifier to the mapping:
Add the target definition ODS_CUSTOMER_ACTIVE. Save the repository. Step 5. Create a lookup transformation. Click the Lookup Transformation button. Position the pointer in the workspace and click again. The Select Lookup Table for Lookup Transformation dialog appears.
Since the EMPLOYEE_TGT table which is imported as a target. Click OK and a Lookup transformation will appear in the workspace. Rename the Lookup transformation
8- 4
lkp_EMPLOYEE_TGT.
The Edit Transformations dialog box appears. Click on the Condition tab and click the Add a new condition button:
Select EMPNO and IN_EMPNO for the condition. Change the Connection Information on the Properties tab to $Source:
The Designer will automatically choose the ports to compare based on the sequential order of Lookup ports and Input ports.
8-5
Because the source and lookup tables come from the same database (schema), the $Source variable may be used.
Make sure that Dynamic Lookup Cache check box and Insert/Else update box is checked. Now NewLookupRow input row port is added to ports which is not editable.
0 = Integration Service does not update or insert the row in the cache. 1 = Integration Service inserts the row into the cache. 2 = Integration Service updates the row in the cache.
8- 6
When we select Sequence-ID in the Associated Port column, the Integration Service generates a sequence ID for each row it inserts into the lookup cache.
Change the data type of EMP_PK to Integer.Sequence-Id will be added. Click OK to close the Edit Transformations dialog box. Save the repository.
8-7
Step 6. Create the Router Transformation rtr_EMPLOYEE_TGT Copy/link the following ports from lkp_EMPLOYEE_TGT to the router and create tow new groups INSERT and UPDATE
NewLookupRow EMP_PK EMP_NO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
8- 8
and
Copy/link the following ports from rtr_EMPLOYEE_TGT INSERT Group to upd_EMP_TGT_INS and Update group to upd_EMP_TGT_UPD :
EMP_PK EMP_NO
8-9
ENAME
o o o o
COMM
DEPTNO
Edit upd_EMP_TGT_INS. Click on the Properties tab and add the following expression in the Update Strategy Expression field: DD_INSERT Validate the formula and click the OK button to close the Expression Editor window Edit upd_EMP_TGT_UPD Click on the Properties tab and add the following expression in the Update Strategy Expression field: DD_UPDATE Validate the formula and click the OK button to close the Expression Editor window. Click OK to close the Edit Transformation window. Save your work. Step 8. Drag the target twice into workspace. Rename the targets as EMPLOYEE_TGT_INSERT and EMPLOYEE_TGT_UPDATE.
8- 10
8 - 11
Select the Mapping tab. In the Navigation box, select the source SQ_INVOICE. Under Connections, click on the down arrow native_source and click OK. , select
In the Navigation box, select the target ODS_CUSTOMER_ACTIVE. Under Connections, click on the down arrow select native_target_xx and click OK. ,
Under Properties, the Target load type should be defaulted to Normal. Scroll down to select the Truncate target table option.
Save, validate and start wf_ODS_CUSTOMER_ACTIVE_xx. Monitor and review the results for s_ m_EMP_TGT_DYNAMIC_LOOKUP in the Workflow Monitor. Step 2. Verify results session transformation statistics.
8- 12
8 - 13