mapping non related columns in where condition

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
ravij
Premium Member
Premium Member
Posts: 170
Joined: Mon Oct 10, 2005 7:04 am
Location: India

mapping non related columns in where condition

Post by ravij »

Hi,

I have code like this:

select col1 from tbl1 where tbl1.col2=tbl2.col2 and tbl2.col1=tbl3.col1.

I can create hash file for tbl2.col2 and map with the source table col but how can I map the second where condition because it doesn't have source table in the condition, two tables are different from source table.

thanks in advance.
Ravi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Assuming the first lookup on tbl2.col2 returns tbl2.col1 you can use that anywhere downstream to perform a lookup against a hashed file containing tbl3.col1 as its key.

You can do this in the same Transformer stage, but only by typing (not with the Expression Editor) - and it will stay red but will work.

The preferred technique is to include the result of the first lookup on the output link from the first Transformer, and to use it to perform the second lookup in a second Transformer stage. That way you CAN use the Expression Editor.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply