Page 1 of 1

mapping non related columns in where condition

Posted: Mon Nov 19, 2007 10:56 pm
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.

Posted: Mon Nov 19, 2007 11:24 pm
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.