[resolved] Do a Loop on TMap

One Star

[resolved] Do a Loop on TMap

Hi all,
I need to do a "Loop" on a TMap for write data in CSV output. 
This TMap did 3 out(CSV), and on of 1 output wanted to do a Loop (2 times) for write 2 lines. Just on 1 CSV...If do you see ^^ Smiley Happy
Thanks

Accepted Solutions
One Star

Re: [resolved] Do a Loop on TMap

Hi,
If you are trying to print the each inputrow into a csv file (Table_obs_fluoro.csv) for multiple times (in your case 2) using tLoop, you can go ahead like this.
tMap -->tFlowtoIterate -->tLoop  -->tIterateToFlow--csv file
configure all your column names in tIterateToFlow component in a key ,value pair passion but in the value section map your column value with tFlowToIterate column name like ((String)globalMap.get("out.columnname"))

Hope that helps you.

All Replies
Seventeen Stars

Re: [resolved] Do a Loop on TMap

I have not a clear idea what you are trying to do but you can create in the tMap so called joined outputs which are send their records to the real output. 
One Star

Re: [resolved] Do a Loop on TMap

I understand that there are 3 outputs from tMap. From one of the outputs (out3), you want to write the output of out3 twice in the target file. is that correct?
Thanks,
Karthikeyan J.
www.mytalend.in
Seventeen Stars

Re: [resolved] Do a Loop on TMap

No, a joined output does not appears at real output outside the tMap. A joined output sends it records to the real output. This way you can use a wide schema and unfold it to build from one input record multiple output records.
One Star

Re: [resolved] Do a Loop on TMap

Hi, 
Sorry for my inglish. You can see on the picture what i want. But i dont want the TLoop on the CSV but on the TMap. Dont know how can do that. In the TMap ?! 
 
Thanks
One Star

Re: [resolved] Do a Loop on TMap

Hi,
If you are trying to print the each inputrow into a csv file (Table_obs_fluoro.csv) for multiple times (in your case 2) using tLoop, you can go ahead like this.
tMap -->tFlowtoIterate -->tLoop  -->tIterateToFlow--csv file
configure all your column names in tIterateToFlow component in a key ,value pair passion but in the value section map your column value with tFlowToIterate column name like ((String)globalMap.get("out.columnname"))

Hope that helps you.
One Star

Re: [resolved] Do a Loop on TMap

Hey ! So nice Smiley Very Happy
Its that, and Job OK ! Good explain.
Good day, 
Best regards all.

Re: [resolved] Do a Loop on TMap

I have 2 JDBC Input tables - tJDBCInput (for example student and course). The student table has an primary key which will used as foreign key in course table. So If any student studying more than one course, we'll have multiple entry in course table for that student id.
I want to get all those multiple entries which are matching with student id and store it in another table.
I am new to Talend, Can some one please help me. It is really appreciated. Thanks
 
Thanks and Regards,
Ram