2
votes

I am using Mule Studio to export database results into a .csv file. My flow is as follows

enter image description here

I can connect to the database fine, and use the results in the data mapper. However, when I go to export the results it writes to the file I specified but only adds one row, which is then overwritten by the next row and so forth.

enter image description here

My question is how do I ensure new rows are added to the .csv file from the SQL result? Also, I do not know how to add headings to the .csv file, so the data makes no sense.

enter image description here

My XML config is below

enter image description here

2

2 Answers

2
votes

Try activating streaming for the mapping:

enter image description here

0
votes

I think you need to modify the File output, Add a 'Connector Configuration' and toggle the setting in that config that says 'Output Append'.