Looping through SQL results

Five Stars

Looping through SQL results

I'm wanting to do a SQL query that will give me a list of values
001
002
003
etc.
Then I want to do a process for each returned value where I do some further lookups based on the value, and a denormalize in order to batch the further lookups together.
I need to only look at one initial value at a time due to the denormalize. (At least I believe I have to do it that way)
Any help on ways to go about this would be appreciated, I've imagined using a tLoop, or maybe just iterating off the results, but I'm not sure how I would go about that, as I can't Iterate to a map, etc.
One Star mpa
One Star

Re: Looping through SQL results

Cmills,
I would use a tFlowToIterate and a tFixedFlowInput.
In tFlowToIterate you should disable the default and add a key choosing your column name that contains your list of values. (001,002..)
In your tFixedflowInput you should put the number of rows to 1 and add a column containing the following as value: ((String)globalMap.get("Key Name in tFlowToIterate ")).
So I guess your job would look something like:
tMssqlInput --> tFlowToIterate -(Iterate Link)-> tFixedFlowInput --> Tmap (for your lookups) --> ..
That's how I would do it.
Regards

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog