0% found this document useful (0 votes)
49 views13 pages

Dynamic Lookup: Lab at A Glance................................................................ 2

This lab guide describes exercises for using a dynamic lookup transformation. The exercises will have students: 1. Create a mapping that extracts data from a source flat file and loads it into a target table using a dynamic lookup to the target table, which will serve as the lookup cache. 2. Create a workflow that runs the mapping. 3. Verify the results by checking the session transformation statistics and reviewing the loaded target table data. The lab is designed to take 40 minutes and teaches how to use a dynamic lookup transformation to load a target table from a source file using the target table as the lookup cache.

Uploaded by

alexandrem95
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views13 pages

Dynamic Lookup: Lab at A Glance................................................................ 2

This lab guide describes exercises for using a dynamic lookup transformation. The exercises will have students: 1. Create a mapping that extracts data from a source flat file and loads it into a target table using a dynamic lookup to the target table, which will serve as the lookup cache. 2. Create a workflow that runs the mapping. 3. Verify the results by checking the session transformation statistics and reviewing the loaded target table data. The lab is designed to take 40 minutes and teaches how to use a dynamic lookup transformation to load a target table from a source file using the target table as the lookup cache.

Uploaded by

alexandrem95
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

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 an !un the "or#$%o&............12

PowerCenter 7 Level I Developer Lab Guide

8-1

Lab. Dynamic Lookup

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-

PowerCenter 7 Level I Developer Lab Guide

Lab. Dynamic Lookup

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%

Sa-e the repository.

PowerCenter 7 Level I Developer Lab Guide

8-!

Lab. Dynamic Lookup

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- "

PowerCenter 7 Level I Developer Lab Guide

Lab. Dynamic Lookup

lkp_EMPLOYEE_TGT.

&opy0link the following ports from Double)click on the header of lkp_EMPLOYEE_TGT.


EMP_&O E&AME 'OB MGR (IREDATE SAL COMM DEPT&O

The E)"! Transfor

a!"ons

dialog box appears.

&lick on the Con)"!"on tab and click the A)) a ne* #on)"!"on button%

Select EMP&O and IN

EMP&O

for the condition.


a!"on

&hange the Conne#!"on Infor +Sour#e:


The Designer will automatically choose the ports to compare based on

on the Proper!"es tab to

PowerCenter 7 Level I Developer Lab Guide

8-#

Lab. Dynamic Lookup

the sequential order of Lookup ports and Input ports.

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/ 2 = In!e,ra!"on Ser-"#e up)a!es !.e ro* "n !.e

#a#.e/

8- $

PowerCenter 7 Level I Developer Lab Guide

Lab. Dynamic Lookup

"ust gi-e associated expression.


While using a dynamic lookup cache, we must associate each lookup/output port with an input/output port or a sequence ID. The Integration Service uses the data in the associated port to insert or update rows in the lookup cache. The Designer associates the input/output ports with the lookup/output ports used in the lookup condition.

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.

PowerCenter 7 Level I Developer Lab Guide

8-7

Lab. Dynamic Lookup

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

PowerCenter 7 Level I Developer Lab Guide

Lab. Dynamic Lookup

Ste! 0. Create an u!&ate strate"y trans)ormation.


$se an $pdate "trategy transformation when keeping history information in a table or updating a table to keep the most current information.

&reate two 4pdate Strategy transformation name it upd_EMP_TGT_INS and upd_EMP_TGT_UPD.

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

PowerCenter 7 Level I Developer Lab Guide

8-%

Lab. Dynamic Lookup

E&AME 'OB MGR (IREDATE SAL

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&

PowerCenter 7 Level I Developer Lab Guide

Lab. Dynamic Lookup

Ste! 3. Lin( the tar"et &e)inition.

Link manually from upd !"# T5T ,1S to !"#LO$!! T5T ,1S!/T and upd !"# T5T 4#D to !"#LO$!! T5T 4#DAT!

Sa-e the repository.

PowerCenter 7 Level I Developer Lab Guide

8 - 11

Lab. Dynamic Lookup

Exercise 2: Create an& +un the 4or()lo2


Ste! 1. Create a 2or()lo2. &reate a workflow called "#_EMPLOYEE_DYNAMIC_LKP. &reate a session task called $_ m_EMP_TGT_DYNAMIC_LOOKUP. Double)click on the session task. The E)"! Tasks dialog box appears.

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.

&lick O% to close the E)"! Tasks dialog box.

Link S!ar! to $_ m_EMP_TGT_DYNAMIC_LOOKUP%

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

PowerCenter 7 Level I Developer Lab Guide

Lab. Dynamic Lookup

Ste! $. 5eri)y results.


%ote that only the first few rows are shown here.

PowerCenter 7 Level I Developer Lab Guide

8 - 1!

You might also like