Вы находитесь на странице: 1из 5

How to return multiple coulmn values using

unconnected lookup

How to return multiple coulmn values using unconnected lookup


Hi,

Connected Lookup is straight forward. In Particular if you want to use unconencted


lookup, concatenate both the columns into one column in lookup override query and in an
expression split them.

How to return multiple coulmn values using unconnected lookup


Hi,

Unless you have a clear instruction to use a Unconnected lookup you should always go
for connected lookup if you want the lookup to return more than 1 column. Unconnected
lookups are frequently used in fact table load where you need to look up the dimension
table to retrieve the dimension key ( single column). I am not saying here that
unconnected lookup is only used for fact table load but is frequently used in this scenario.

2> QUESTION: How to return multiple coulmn


values using unconnected lookup

Today we check how to return multiple ports from unconnected lookups. Before that why do we need
this?? First of all, Informatica power center does not let us return more than single port and there are
advantages of unconnected lookup like performance, reusability. Confused?? Let me explain!!

Unconnected lookup does not participate in mapping data flow. In fact it is not connected to the other
transformation so Informatica server creates a separate cache for unconnected and processing takes place
in parallel. That’s why performance increases.

The major advantage of unconnected lookup is its reusability. We can call an unconnected lookup multiple
times in the mapping unlike connected lookup.

So let’s see if we have to get employee full name from employee through unconnected lookup and then
break it in Expression transformation.

We crate below lookup to get the employee complete name by concatenating them with separator ‘~’
And in SQL over ride, we write the query
Now we break the values in expression transformation as below:

i) declare 3 variables with

VAR–> V_F_NAME = INSTR(NAME,’~',1,1) ;

V_M_NAME = INSTR(NAME,’~',1,2) ;

V_L_NAME = INSTR(NAME,’~',1,3)

ii) Then create output port and use below expressions:

F_NAME = SUBSTR(NAME,1,V_F_NAME-1) ;

M_NAME = SUBSTR(NAME,V_F_NAME+1,V_M_NAME-V_F_NAME-1);

L_NAME = SUBSTR(NAME,V_M_NAME+1,V_L_NAME-V_M_NAME-1) ;

EMP_NO = SUBSTR(NAME,V_L_NAME+1,V_L_NAME-V_M_NAME-1) ;

Now, lets see how these calculations work? We can also perform similar calculation in SQL.

With Strng AS(SELECT NAME Name,


INSTR(NAME,’~’,1,1) V_F_NAME,
INSTR(NAME,’~’,1,2) V_M_NAME,
INSTR(NAME,’~’,1,3) V_L_NAME FROM EMPLOYEE)
SELECT NAME,SUBSTR(NAME,1,V_F_NAME-1) F_NAME,
SUBSTR(NAME,V_F_NAME+1,V_M_NAME-V_F_NAME-1) M_NAME,
SUBSTR(NAME,V_M_NAME+1,V_L_NAME-V_M_NAME-1)L_NAME,
SUBSTR(NAME,V_L_NAME+1,V_L_NAME-V_M_NAME-1)EMP_NO
FROM STRNG;

And output is

If one flat file contains n number of records., we have


to
Question load the records in target from 51 to 100.. how to use
expressions in Informatica..?
Question Submitted By :: Moorthi_cs
I also faced this Question!! Answer Posted
Rank
By

Re: If one flat file contains n number of records., we have to load the
records in target from 51 to 100.. how to use expressions in
Informatica..?
Answer use sequence generator to get 0 Reena
# 1 row no. for each record ,then
use filter giving the
condition (row no.greater
than 50 and
less than 100)

Is This Answer Correct ? 12 Yes 2 No


Re: If one flat file contains n number of records., we have to load the
records in target from 51 to 100.. how to use expressions in
Informatica..?
Answer Use count variable 0 Chakri
#2
Use Variable port

Expression transformation

(Count>50) and (count<100)

Please let me know any


information

Is This Answer Correct ? 6 Yes 2 No

Re: If one flat file contains n number of records., we have to load the
records in target from 51 to 100.. how to use expressions in
Informatica..?
Answer i dont think count works in 0 Sujana
# 3 dis scenario...first answer
works

Is This Answer Correct ? 1 Yes 2 No

Re: If one flat file contains n number of records., we have to load the
records in target from 51 to 100.. how to use expressions in
Informatica..?
Answer We can filter the records in
# 4 UNIX itself, then we can use
that filterd file as a source
to the mapping.

Is This Answer Correct ? 0 Yes 1 No

Вам также может понравиться