Dynamic Lookup: Lab at A Glance................................................................ 2
Dynamic Lookup: Lab at A Glance................................................................ 2
Dynamic Lookup
Lab at a Glance................................................................2 Objectives..............................................................2 Summary................................................................2 Duration.................................................................2 Exercises..........................................................................3 Exercise 1: Create the Mapping.............................3 Exercise 2: Create an !un the "or#$%o&............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 !"#LO$!! table with records. The data will be extracted from the !"#LO$!! flat file. The target table ODS !"#LO$!! table will be used as the lookup table. SOURCE% !"#LO$!! flat file TARGET% ODS !"#LO$!! The completed mapping should look as follows%
Duration
This lab should take approximately 40 minutes.
8-
Exercises
Exercise 1: Create the a!!in"
Ste! 1. #m!ort the source table. &lear the Source Analy'er workspace (right)click anywhere in the workspace and select Clear All*. &ontinue 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%
Ste! 2. #m!ort the tar"et. &lear the +arehouse Designer workspace (right)click anywhere in the workspace and select Clear All*. ,mport the EMPLOYEE_TGT relational database target table from the TDBUxx database schema. The target should look as follows%
8-!
Ste! 3. Creatin" a ma!!in". &reate a mapping called m_EMP_TGT_DYNAMIC_LOOKUP. Ste! $. %&& source an& tar"et. Add the EMP source definition with its respecti-e Source .ualifier to the mapping%
Add the target definition ODS_CUSTOMER_ACTIVE. Sa-e the repository. Ste! '. Create a loo(u! trans)ormation. &lick the Lookup Transfor a!"on button. #osition the pointer in the workspace and click again. The Sele#! Lookup Ta$le for Lookup Transfor appears.
a!"on
dialog
Since the EMPLOYEE_TGT table which is imported as a target. &lick O% and a Lookup transformation will appear in the workspace. /ename the Lookup transformation
8- "
lkp_EMPLOYEE_TGT.
a!"ons
&lick on the Con)"!"on tab and click the A)) a ne* #on)"!"on button%
EMP&O
8-#
Because the source and lookup tables come from the same database (schema) the !"ource #ariable may be used.
"ake sure that Dynamic Lookup &ache check box and ,nsert0!lse update box is checked. 1ow 1ewLookup/ow input row port is added to ports which is not editable.
0 = In!e,ra!"on Ser-"#e )oes no! up)a!e or "nser! !.e ro* "n !.e #a#.e/ 1 = In!e,ra!"on Ser-"#e "nser!s !.e ro* "n!o !.e
#a#.e/
8- $
When we select Sequence-ID in the ssociated !ort column, the Integration Service generates a sequence ID "or each row it inserts into the lookup cache.
&hange the data type of !"# #2 to ,nteger.Se3uence),d will be added. &lick O% to close the E)"! Transfor Sa-e the repository.
a!"ons
dialog box.
8-7
Ste! *. Create the +outer ,rans)ormation rtr-E .LO/EE-,G, &opy0link the following ports from lkp_EMPLOYEE_TGT to the router and create tow new groups ,1S!/T and 4#DAT!
&e*LookupRo* EMP_P% EMP_&O E&AME 'OB MGR (IREDATE SAL COMM DEPT&O
8- 8
and
&opy0link the following ports from rtr !"#LO$!! T5T ,1S!/T 5roup to upd_EMP_TGT_INS and Update gr up t upd_EMP_TGT_UPD %
EMP_P% EMP_&O
8-%
COMM DEPT&O
!dit upd_EMP_TGT_INS. &lick on the Proper!"es tab and add the following expression in the Up)a!e S!ra!e,0 Express"on field% DD_INSE!T 6alidate the formula and click the O% button to close the Express"on E)"!or window !dit upd_EMP_TGT_UPD &lick on the Proper!"es tab and add the following expression in the Up)a!e S!ra!e,0 Express"on field% DD_INSE!T 6alidate the formula and click the O% button to close the Express"on E)"!or window. &lick O% to close the E)"! Transfor Sa-e your work. Ste! 1. Dra" the tar"et t2ice into 2or(s!ace. /ename the targets as !"#LO$!! T5T ,1S!/T and !"#LO$!! T5T 4#DAT!.
a!"on
window.
8- 1&
Link manually from upd !"# T5T ,1S to !"#LO$!! T5T ,1S!/T and upd !"# T5T 4#D to !"#LO$!! T5T 4#DAT!
8 - 11
Select the Mapp"n, tab. ,n the 1a-igation box, select the source S1_I&VOICE. 4nder Conne#!"ons, click on the down arrow na!"-e_sour#e and click O%. , select
,n the 1a-igation box, select the target ODS_CUSTOMER_ACTIVE. 4nder Conne#!"ons, click on the down arrow select na!"-e_!ar,e!_xx and click O%. ,
4nder Proper!"es, the Tar,e! loa) !0pe should be defaulted to &or al. Scroll down to select the Trun#a!e !ar,e! !a$le op!"on.
Sa-e, -alidate and start *f_ODS_CUSTOMER_ACTIVE_xx. "onitor and re-iew the results for $_ m_EMP_TGT_DYNAMIC_LOOKUP in the +orkflow "onitor. Ste! 2. 5eri)y results 6 session trans)ormation statistics.
8- 1
8 - 1!