lookup with multiple columns

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

If your data is not huge get the cartesian product that will return you m*n where m is number of rows in file and n is number of rows in other table.

Then you can add filter and put conditions for matching as per your need. So after cartesian product, you will get col1Fromfile, Col1FromTable and so on. Use the condition as follows to send the required rows.

Code: Select all

(Col1FromFile='*' Or Col1FromTable=Col1FromFile) And (Col2FromFile='*' Or Col2FromTable=Col2FromFile)...
HTH.
Regards,
S. Kirtikumar.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Re: lookup with multiple columns

Post by swades »

Is there is 1:1 or 1:N relationship between file and table?if there is 1:N you cann't perrform look-up.please explain more about this.


vsi wrote:I have a file with fields field1,field2,field3,field4,field5,field6,field7. and a table with columns col1,col2,col3,col4,col5,col6,col7,col8. i have to perform a lookup from file to the table and retrieve the col8 from the table.
some of the fields of the file may contain "*" as values, then match with the remaining columns and retrieve the col8 from table.

example :record in the file 101,10,*,30,40,50,60

in the table 101,10,20,30,40,50,60,1001
101,10,70,30,40,50,60,1002

result should be 1001
1002
need ur help to solve this.

Thanks in advance
Post Reply