Ahmad Farhat · Feb 15, 2021

Business Service SQL results in only 1 file instead of each row in a file

Hello all,

I have a Business Service which retrieves data via a SQL adapter and writes the data in text file. My production is doing the job, but instead of the Business Operation output being one file, I am getting many files, with 1 , 2 or 3 rows only. 


Any help is appreciated. 

Thank you 



Product version:
Ensemble 2018.1
2 0 3 61


The SQL Inbound Adapter is normally used in such a way that produces a new message per Row.

The File Outbound Adapter is normally used in such a way that produces a new File per received message. Check the overwrite setting (put it to false to append new lines) and verify that when you use PutLine you are using the same file name.

Thank you @Julian Matthews and @David Reche  , the culprit was the timestamp name. I appreciate the help. I renamed the file using just the date substring from the CurrentDateTime. worked like a charm . Stay Safe !!

Just to expand on Davids response - the File Outbound adapter will create a new file per message assuming the filename settings are configured so that the filenames it produces are unique per message.

If you were to set the Filename property to a specific value rather than use the timestamp specifiers (so for example set it so that the filename is output.txt) then each message should write the data at the end of the file, giving you a single file with all of the entries.