Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hi, I have a problem with look up.

Status
Not open for further replies.

vsn2009

Programmer
Jan 20, 2004
10
US
hi,
I have a problem with look up.
I need to have a field value from another target table say"DD".
so i created a look up table in my current map.but how to link its input port??
can anyone give a good example for unconnected look up.
thanks!!!
 
Here's an example

create an Unconnected Lookup can call it

lkp_DD
------
lkp_fld1 O L R
in_fld_1 I

In the condition

lkp_fld1 = in_fld_1

I assume that you know how to get the target table and the field.

Must be wondering where to get the in_fld1 value.

Lets say that in your mapping you have a source definiton in which you have the field that you want to specify in your input field ( eg Bank ).since its an unconnected lookup , you obviously dont link the port to the input port of the lookup.

Therefore what you need to do is to pass the field in the source def to a expression transformation.

create another port in the exp trans and call it o_lkp or something.
In the expression box

Lkp.lkp_DD(Banks)



I hope this should explain.



 
Hi,
I'm telling you step by step.
a) Say you have a port called Input_Field in your source table based on which you want the field DD from your lookup table. Assume you have another field called Lkp_Field in the lookup table which you need to match with the Input_Field, and if these match, you get the DD.
b) Get the Lookup table in your mapping using a lookup transformation say with name Lkp_DD(Don't connect any link from anywhere, that's why unconnected lookup).
c) Mark Lkp_Field and DD as lookup port.
d) Manually create a port with name Input_Field and datatype and precision as given in the source table.
e) Specify the lookup condition as Input_Field=Lkp_Field.
f) Mark the DD port as return port.
g) Now proceed with the port Input_Field from the source qualifier. Take it in an expression transformation.
h)Create an output port with name Output_DD.
i) Put the expression :LKP.Lkp_DD(Input_Field)

So in the expression transformation Input_Field will be replaced by corresponding DD value.

Things to take care of:
a) It is always better to use connected lookup rather than unconnected lookup.
b)There should be only one return port in the lookup transformation.

I hope this will ease your problem.
Regards,
Ani.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top