Inner Join in ServerEdition

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
kondeti
Premium Member
Premium Member
Posts: 67
Joined: Sat Mar 04, 2006 11:38 am

Inner Join in ServerEdition

Post by kondeti »

Hi

How we can implement the inner join in the ServerEdition. I got a business requirement as a Sql Query. I implemented the same query in the DS ServerEdition by using 2 DRS stages as source and one Transformer. I joined single column in the Transformer, Based on the join i derived some columns from Stream Link and Some columns from Reference Link.

Job is completed but i got a different output.

From the Reference Link I am getting 6000 Records from the Stream Link I am getting 45000 Records after performing join operation it's producing 45000. That output is not matching with the SQL Query which i run in the database. I understand my is performing LeftOuter join.
How can I Achieve inner join operation by using Transformer.

Thanks
kris
Participant
Posts: 160
Joined: Tue Dec 09, 2003 2:45 pm
Location: virginia, usa

Re: Inner Join in ServerEdition

Post by kris »

Not sure why you want to perform this type of join, but if it is a simple join that you need, you can do this join in the database by running the join query in the DRS stage and selecting all the columns you need.

Anyways, join in a transformer with a streamlink and a reference link without any constraints will produce LeftOuter(Default) join.

You need constraint in the transformer to make it inner(equi) join.
In the transformer, after matching your key columns which you want to join on, in the Constraint box, right click and you will see link variables.

constraint

Code: Select all

NOT(referencelink.NOTFOUND)
will give you the innder join.
~Kris
kris
Participant
Posts: 160
Joined: Tue Dec 09, 2003 2:45 pm
Location: virginia, usa

Re: Inner Join in ServerEdition

Post by kris »

Not sure why you want to perform this type of join, but if it is a simple join that you need, you can do this join in the database by running the join query in the DRS stage and selecting all the columns you need.

Anyways, join in a transformer with a streamlink and a reference link without any constraints will produce LeftOuter(Default) join.

You need constraint in the transformer to make it inner(equi) join.
In the transformer, after matching your key columns which you want to join on, in the Constraint box, right click and you will see link variables.

constraint

Code: Select all

NOT(referencelink.NOTFOUND)
will give you the innder join.
~Kris
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

kondeti - that's not a "workaround", that is the answer. Constrain your output to only the lookup rows that succeeded = inner join.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kondeti
Premium Member
Premium Member
Posts: 67
Joined: Sat Mar 04, 2006 11:38 am

Post by kondeti »

Thank You.

Thanks
kondeti
Premium Member
Premium Member
Posts: 67
Joined: Sat Mar 04, 2006 11:38 am

Post by kondeti »

Thank You.

Thanks
Post Reply