Create CSV from database data.

Hi, i need to create CSV files from a dataset retrieved from a database. The data coming in ( the output of adapter service) is in the form of document list. Now how to convert this document list to an IS doc such that, this document can be fed to the convertToString service for creating the required CSV string?
In The tutorial codes, in the WmFlatFileSamples package, a .txt file is loaded from the local file system into the IS. I am using IS 6.1.

Thanks :slight_smile:

Before using convertToString services you will have to create a flat file schema with a delimeter as ,(comma). Flat file schema will help you to generate a document type list which can be passed to convertToString services. Refer to Flat File Schema Developers Guide.

OK, please tell me if i am doing this right.

The data i get from the adapter service is in the form of a documentList containing the records.
I have defined a ffSchema from which i get the flat file document type.

Now i run a loop with the documentList as the input array and the flat file document type as the output array.(i have set the records in the schema to have unlimited limit, in the properties panel)

Then in the loop, i map the data from the documentList to the corresponding fields defined in the flat file document type.

This document type , i then pass to convertToString.
:slight_smile: