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!

lookup problem

Status
Not open for further replies.

donny750

Programmer
Jul 13, 2006
145
FR
hello,

I have a problem;
I have 2 oracle tables(t1(id_cust,contact);t2(id_cust,name,age)) and one flat file(id_cust,contact);
flat file have 4 lines;
t2 have 34 lines;

i must load the data from the flat file to the target table t1;
but i must load in t1 just the line where the id_cust exist in t2;

for example
flat file
id_cust contact
1 Bob
2 Ben
t2
id_cust name age
1 Bob 34
3 Ryan 23
4 John 45
5 tommy 26
in t1,i load just (1,bob) because id_cust in t2 exist;

I have use a lookup in my mapping;i select target and select my table t2;
I join id_cust from my source qualifier flat file to my lookup and rename it cust_id_in;in the condition tab, i have add a conditon : id_cust=id_cust_in;
i join id_cust(from the lookup) to the id_cust in my target t1;and i join contact from my source qualifier flat file to contact in my target t1;
then i look the data in t1 and i have :
1 Bob
Ben


normaly i must have only

why ???
thanks for help me;

 
if i join all port from my flat file source qualifier to my lookup and after i join my lookup port (just the lookup port and not the port from my source qualifier) to my target;
when i saw the result i have :
id_cust contact

1 Bob

when i make select count(*) from t1, i obtained 2;
there 2 line but i see just one line;
normally the result is one and i see the line with the id_cust 1 and contact Bob ,not this line with a white line
 
Why use a lookup when you can handle this problem with a simple joiner?
Read both flatfile and t2 and use an inner join on id_cust
This will insure that you will only load data from flatfile if the id_cust exists in t2

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top