[resolved] Iterate over a group of related data

One Star

[resolved] Iterate over a group of related data

Hi,
I have an Excel file containing data that must be transfer to a database.
Each row of the Excel corresponds to a group a data. the groups are independent from each other.
My thought was to create a job where I can iterate on each row of the Excel:
-perform the data migration of the group
- commit the data changes for that group
Does some of you already created such jobs?
Is there a way to parallelize its running?
Cheers,
Sebastien

Accepted Solutions
Community Manager

Re: [resolved] Iterate over a group of related data

Hi
About how to pass a variable value from parent job to child job, see this topic:
http://www.talendforge.org/forum/viewtopic.php?id=1654
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: [resolved] Iterate over a group of related data

Hi Sebastien
Yes, I have created so many such kind of job, the job looks like, let's take Mysql for example:
parent job:
tMysqlConnection_1
|
onsubjobok
|
tFileInputExcel--row1--tFlowToIterate--tRunJob---oncomponentok---tMysqlCommit
----oncomponenterror---tMysqlRollback
child job:
tMysqlConnection_2
|
onsubjobok
|
tFixedFlowInput--do any process---tMysqlOutput
on tmyslqConnection_1: create the database connection, check the box 'use or register a shared db connection', type in a db connection name.
on tmyslqConnection_1:
on tRunJob: uncheck the box 'die on error', check the box 'use or register a shared db connection', type in the db connection name.
on tFixedFlowInput: receive the flow sent by parent job using context variables.
on tMysqlCommit: commit the change on each row, uncheck the box'close connection'.
on tMysqlRoll: roll back the change if it occurs error on row, uncheck the box'close connectin'.
If you have troubles, please give us more details about your request.

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Iterate over a group of related data

Hi Shong,
May you please give me more detail on how to set and use context variables?
Sebastien
Community Manager

Re: [resolved] Iterate over a group of related data

Hi
About how to pass a variable value from parent job to child job, see this topic:
http://www.talendforge.org/forum/viewtopic.php?id=1654
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Iterate over a group of related data

Thanks for your fast reply.
It works as I dreamed of :-)
Cheers,
Seb