Escolar Documentos
Profissional Documentos
Cultura Documentos
SCD TYPE2
Lab at a Glance
The exercises in this lab are designed to walk the student
through the process of using a Lookup transformation and an
Update Strategy transformation to do an SCD type1
implementation.
Objectives
After completing the lab, the student will be able to:
Understand the how to load SCD type 2
Summary
The purpose of this lab is to pull information from the
SCD_INPUT flat file. The DIM_SUPPLIER2 table will be
updated to keep only the current and Historical suppliers
information.
The completed mapping should look as follows:
Duration
This lab should take approximately 40 minutes.
Exercises
Click OK.
Copy/link SUPPLIER_CODE from SQ_SCD_INPUT to the
Lookup transformation.
Rename the Lookup transformation
lkp_DIM_SUPPLIER2.
Rename the port SUPPLIER_CODE, which came from
sq_SCD_INPUT, to SUPPLIER_CODE_in.
V_LKP_MD5, Datatype=string,
Prec=1000(default), Port
Type=Variable Only
CHG_FLAG, Datatype=string,
Prec=1(default), Port Type=Output
Only
CHG_FLAG, Datatype=string,
Prec=1(default), Port Type=Output
Only
INS_FLAG, Datatype=string,
Prec=1(default), Port Type=Output
Only
V_SRC_MD5=MD5(Supplier_Name_SRC||Supplier_State_SRC)
V_LKP_MD5=MD5(SUPPLIER_NAME_LKP||SUPPLIER_STATE_L
KP)
INS_FLAG= IIF(ISNULL(SUPPLIER_CODE_LKP),'Y','N')
out_CURR_DATE=SYSDATE
out_MAX_DATE= TO_DATE('31-DEC-2999','DD-MON-YYYY')
out_PREV_DATE= ADD_TO_DATE(SYSDATE,'DD',-1)
If it is not the last group, select the DEFA ULT group and
move it to the bottom. Order does not matter to row
evaluation, but is helpful for clarity.
Click OK.
Step 4. Create Sequence Generator transformation.