How to save my data from resltset into file
Hi Community,
We need to export last 5 days Ens.MessageHeader data for a specific messages into file. I have written custom code to execute SQL query in object script.
Could somebody help me to iterate resultSet and write the data to text file.
Product version: Caché 2017.1
Check this answer if you need a CSV file.
If you need some custom format:
Thanks Eduard ,
I can see extraction logic in above code but final step is how to write the data into file.
Yes csv file also fine , I want to store this file in file system like d://sample/history.csv
I did not see file path in the attached code.
Thanks a lot
File is a first parameter in the ToCSV example.
Thanks a lot Eduard , it works for me.
If you need to export the result of SQL to CSV you can use csvgen lib.
install csvgen:
Perform export: