Oracle Business Intelligence Application Architect
☎ +91 9994883085
Don't miss

Monday, 9 September 2013

DYNAMIC LOOKUP WITH UPDATE STRATEGY IN INFORMATICA


By on 02:02:00




Steps:

Create a new mapping M_US. Drag the source (EMP), target (DIM_JOIN) to the mapping designer workspace. The target table should have a Primary Key.

Create a Lookup Transformation T_LKP_DYN on the target table DIM_JOIN.

DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY



DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY



Project the source ports on the Lookup Transformation.
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY



Note: Source ports (EMPNO1,ENAME1, etc. ) are created in the Lookup transformation. Edit the Lookup transformation, Go to Properties Tab.

Check the property Dynamic Lookup Cache 

Note that after this property is checked following options get highlighted:

Ø Output Old value On Update

Ø Insert Else Update

Ø Update Else Insert




Before checking Dynamic Lookup Cache property
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY






After checking Dynamic Lookup Cache property
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY








Select the Property Insert Else Update
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY






Now go to Condition Tab and add a condition EMPNO = EMPNO1
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY






Go to the Ports tab.

A new port called NewLookupRow is inserted in to the set of ports.

Lookup uses NewLookupRow to identify changes in the Cache

0 No change

1 INSERT

2 UPDATE

It decides what type of data it is – 1 means Inserted data, 2 means updated data.

The condition EMPNO=EMPNO1 is disabled here (it has already been applied in the condition tab).

We apply additional conditions here.

ENAME=ENAME1

JOB=JOB1

MGR=MGR1

HIREDATE=HIREDATE1

SAL=SAL1

COMM=COMM1

DEPTNO=DEPTNO1

DNAME = ENAME1 (not logical, but we still give this condition because otherwise if we don’t assign a value here, it will throw an error and in cache it will be NULL. Since DNAME is not in the source it will just pass ENAME)
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY


DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY






Go to the Transformation Menu and create an Update Strategy transformation. T_UPS

Project the output ports from Lookup Transformation to Update Strategy.
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY



Edit the Update Strategy transformation. Go to Properties tab 

In the Formula bar give the following condition:

IIF(NewLookupRow=1,DD_INSERT,IIF(NewLookupRow=2,DD_UPDATE,DD_REJECT)) is equivalent to

IF (NewLookupRow=1)

THEN 

DD_INSERT

ELSIF NewLookupRow=2

THEN 

DD_UPDATE

ELSE 

DD_REJECT
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY




DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY



An automatic projection happens from lookup transformation to the update strategy port NewLookupRow.

At runtime it decides whether to INSERT or UPDATE.

By default, Session Property is INSERT.




Project the update strategy ports to the target.
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY



Save the repository and validate the mapping.




Create a workflow WKF_LKP_DYN_UPS

Assign the Source and Target connections.

Note: In the Target connection give Load Type as Normal (as the TGT is having primary key) and do not select truncate the target table option because here we want to see the changes.
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY



Assign the connection for the Lookup Connection (MEEN_TGT because lookup table is DIM_JOIN which is in the target database).
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY






Select the Dynamic Lookup Cache option and Insert Else Update option.
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY





In the Session properties set the attribute Treat source rows as to Data Driven.

Save the repository. Validate and start the workflow .




Preview the output of the target table.
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY





Normal output

Now let us observe the newlookuprow attribute.

INSERT a new record in the Source table EMP.



SQL> INSERT INTO EMP(EMPNO,ENAME,SAL,DEPTNO)

2 VALUES (9000,'MEENAKSHI',3000,10);



1 row created.



SQL> COMMIT;

Preview the output again
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY



The new record has been INSERTED.




Now let’s Update

SQL> update emp

2 set sal=3500

3 where empno=7499;

1 row updated.

SQL> commit;

Preview the output
DYNAMIC LOOKUP WITH UPDATE STRATEGY
DYNAMIC LOOKUP WITH UPDATE STRATEGY

0 comments:

Post a Comment

Blog Archive

Labels

1z0-482 Dumps (2) 1Z0-525 Dumps (1) BI Apps Installation (1) BI Publisher Interview Questions (1) BICS (2) Business Intelligence (1) DATA WAREHOUSE ADMINISTRATOR CONSOLE (18) Data Warehousing (48) E-BIZ R12 (1) E-BIZ R12 INSTALLATION (1) Essbase (1) hmailserver (1) Hyperion (1) Hyperion Essbase (2) Hyperion Essbase Interview Questions (1) Hyperion financial management (1) Informatica (163) Informatica Installation 9.6.1 (2) Informatica Interview Question (47) Informatica Online Training (1) informatica scenarios questions (1) Informatica Training (1) Informatica Training Chennai (1) JAVA (1) linux (1) Normalization in Oracle (1) OBIA 11.1.1.7.1 (1) OBIA 7.9.6.3 (3) OBIA Installation (33) OBIEE (2) OBIEE 10G (8) OBIEE 11G (138) OBIEE 11g dumps (2) OBIEE 11g Interview Questions (1) OBIEE 12c (20) OBIEE 12c Architecture (1) OBIEE 12C TRAINING (1) OBIEE certification (2) OBIEE Interview Question (1) OBIEE Publisher Interview Questions (1) OBIEE TRAINING CHENNAI (1) OBIEE TRAINING ONLINE (1) ODI (Oracle data integrator) (2) odi 11g certification (1) ODI dumps (2) Oracle Administrator (20) Oracle Business Intelligence Application (3) Oracle Data Integrator (2) Oracle Data Integrator Interview questions for experience (1) Oracle Database (3) Oracle Database 12c Installation steps (3) Oracle Database Installation in Linux 6 (2) Oracle E-Business R 12.3 (1) Oracle Hyperion Planning and Budgeting Questionnaire (2) oracle Joins (1) Power BI (5) RCU INSTALLATION (1) scorecard in obiee 11g (1) SQL (3) SQL Interview Questions (1) sql server 2008 (2) Sql server installation (1) WinSCP (1)