[resolved] to extract multiple tables using same job

Six Stars

[resolved] to extract multiple tables using same job

I have one job where i made reusable to read and write irrespective of the table structure..kind of simple dump from source to stg.This one job based on the two parameters i give,it should execute iteratively.
for example, for one module i had to extract 4 tables i am thinking to store this module name and the 4 tables source names in one metadata table and then use it for the reusable job.so that my main input wil be only the module name.it automatically should take the table names from the metadata table and then execute the reusable job.can anyone help me how can i do this automated ..
I amthining that i can use tcontextload and then assign this to the child job contexts.but not geting clue how can i iterate.can someone help?
Community Manager

Re: [resolved] to extract multiple tables using same job

Hi
You have to define schema to map the table structure, do the all the tables have the same table structure? 
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Six Stars

Re: [resolved] to extract multiple tables using same job

noo i dont have same structure..but i had made a reusable job already to read and dump ..
i just need a clue how can i iterate to read the source table one by one.. and the run the same job..to load different targets
Community Manager

Re: [resolved] to extract multiple tables using same job

You can use tFlowToIterate to trigger the same job for each table, can pass the current table name to the job. For example:
tFileInputDelimited--main--tFlowToIterate--iterate--tRunjob
tFileInputDelimited, read the table name from a file.
or 
tTableList (if you want to read the table name from database one by one)--iterate--tRunJob 
Take a look at tFlowToIterate to learn how to use tFlowToIterate and how to access the table name from the input data.
See this KB article to know how to pass the table name from the parent job to the child job.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] to extract multiple tables using same job

I have one job where i made reusable to read and write irrespective of the table structure..kind of simple dump from source to stg.This one job based on the two parameters i give,it should execute iteratively.
for example, for one module i had to extract 4 tables i am thinking to store this module name and the 4 tables source names in one metadata table and then use it for the reusable job.so that my main input wil be only the module name.it automatically should take the table names from the metadata table and then execute the reusable job.can anyone help me how can i do this automated ..
I amthining that i can use tcontextload and then assign this to the child job contexts.but not geting clue how can i iterate.can someone help?

Hi sanjana,
Could you please share me the code details. I too have same requirement like you. Please help me.
Thanks
One Star

Re: [resolved] to extract multiple tables using same job

Hi Sanjana, Could you please share me the code details. I too have same requirement like you.
Thanks.