Iterate Row by Row and pass on the row value to Job

One Star

Iterate Row by Row and pass on the row value to Job

Hello,
I need to perform following job:
There is a job named Daily_ETL which populates certain MySQL tables on a daily basis, when the a date parameter is passed to it.
Now I want to make version 2 of this job which populates those tables for past dates
For that purpose, I have a table in database which lists all dates (from 2 years back to current date).
I want to read that table row by row and pass on the date value to my job which essentially has SQL queries. The date parameter shall be embedded in those queries.
I tried tMysqlInput ->tJava but all it prints is null.
I'll be greatly thankful if this gets resolved Smiley Happy
I have attached snapshots of the job so as to correct me where I'm going wrong.
thanks.
PS- I'm new to forums Smiley Tongue

Re: Iterate Row by Row and pass on the row value to Job

try this way:
tMysqlInput--row1-->tFlowToIterate--iterate-->tJava
the column values will be put in the global map:
globalMap.get("row1.column_name");
One Star

Re: Iterate Row by Row and pass on the row value to Job

Thank you so much John. It worked!
One Star

Re: Iterate Row by Row and pass on the row value to Job

Hi..

As you have worked on date , do you know how to work on time type...
Talend doesnt suppot only time data type I guess...
Please need a help regarding this...
Highlighted
Moderator

Re: Iterate Row by Row and pass on the row value to Job

Hi jai,
All the Talend date method can be found in Talend code-->routine-->TalendDate where you can find all and globalMap.

Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Seventeen Stars

Re: Iterate Row by Row and pass on the row value to Job

hi,
you cannot write a flow in a tJava component (or using using iteration like JohnGarrettMartin suggestion).
It's the reason you 've got null value.
To flow data through tJava componenet, use tJavaRow.
regards
laurent