Reputation: 53
I'm trying to get variables from table input, table input return this data:
I want to use this data to get other data in a other table input:
select id, name, date, nightmare from table where id = ${ID} and name = ${name}
or better:
select id, name, date, nightmare from table where id in ${ID} and name in ${name}
Note: - ${..} -> variable - I can't do subquery, each query are in different dbms
Thanks
Upvotes: 1
Views: 7472
Reputation: 4544
What you're after aren't variables, which would need to be set before the transformation initialises and are always single values.
You're after parameters.
Your Table input1 returns several rows of data with fields id
and name
; you connect it to a new Table Input where you want to pass these values, for example, in the where clause:
select * from customers
where id = ? and name = ?
The question marks will be replaced by the values coming from the previous step.
You just need to fill in the name of the first step in the box "Insert data from Step" and check the "Execute for each row" box.
Now your query will run once for each row arriving at that step, and the values will be replaced.
Caveat:
If you need to use the same parameter multiple times or use them in a different order you'll need to change the structure of your incoming data stream with a Select Values step.
Upvotes: 1