multiple row from lookup

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

Post Reply
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

multiple row from lookup

Post by dodda »

Hi All,

I have data like this,

Soucre file has (seq file)

col1 col2
1 NAP

Lookup data from database (oracle stage0
col1 col2
1 AB
1 CD
1 EF
2 HJ

I want to retrieve multiple rows from lookup data My final target data file should like as below
col1 col2 col3
1 NAP AB
1 NAP CD
1 NAP EF

Please help

Thanks
girija
Participant
Posts: 89
Joined: Fri Mar 24, 2006 1:51 pm
Location: Hartford

Post by girija »

Select "Multiple rows returned from link".
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

Hello

Thanks for your reply.

Where should i select multiple rows returned from the link

Thanks
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

Sorry i gave the wrong requirement. I need the output format to be

1 NAP AB CD EF

Regards
girija
Participant
Posts: 89
Joined: Fri Mar 24, 2006 1:51 pm
Location: Hartford

Post by girija »

lookup stage --> link tab
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

i did not see any thing like select multiple rows
dodda
Premium Member
Premium Member
Posts: 244
Joined: Tue May 29, 2007 11:31 am

Post by dodda »

i did not see any thing like select multiple rows
girija
Participant
Posts: 89
Joined: Fri Mar 24, 2006 1:51 pm
Location: Hartford

Post by girija »

1. Double click in your lookup stage.
2. Click on "Constraints" button (Second left from top-left corner)
3. Select your link from the list of "Multiple rows returned from link"
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

get all multiple rows from the reference, then use a sort stage to sort the data on first two column (1 NAP) and then in a transformer stage, concatnate for all column3 values for same key (1 NAP)
Post Reply