oursgris
oursgris

Reputation: 2882

Iterate on a tMssqlInput in Talend

I use the last version of Talend 5.3.1.

I have a tmssqlInput which query my database like :

SELECT IdInvoice, DateInvoice, IdStuff, Name FROM Invoice
INNER JOIN Stuff ON Invoice.IdInvoice = Stuff.IdInvoice

which result in something like this

IdInvoice    | DateInvoice | IdStuff    | Name
1            | 2013-01-01  | 10         | test
1            | 2013-01-01  | 11         | test2
2            | 2013-02-01  | 12         | test3
2            | 2013-02-01  | 13         | test4

I'd like to export one file per invoice, here the specifications : one header line with IdInvoice;DateInvoice then one line per stuff like IdStuff;Name

example file 1:

1;2013-01-01
10;test
11;test2

example file 2 :

2;2013-02-01
12;test3
13;test4

how can I resolve that case with talend ? Probably in tFileOutputDelimited but how can I have one file with multiple informations and iterate over each IdInvoice

Upvotes: 1

Views: 6009

Answers (1)

user2759222
user2759222

Reputation: 42

Please go through the following link, you will get clear idea how to split data into multiple files http://www.talendfreelancer.com/2013/09/talend-tflowtoiterate.html

Upvotes: 3

Related Questions