Page 1 of 1

CSV File contains just field names

Posted: Thu Apr 24, 2025 11:30 am
by sarnusch
Hello,

I just updated to Version 10.3.2.311 and noticed that the action 'SQL Query to CSV File' creates a file even if there is no data in the query.
The CSV file just contains field names.
In my case I want to check if there are new entries in the database, then create a CSV file with the data and send it via mail to a user.
Before I send the mails I checked if the file exists. If it exists there have been new entries and I have sent the CSV via mail. But if it does not exist the mail has not been send.

Now the file is send even when there is no new data because the file is created with field names.

It seems to be a new behaviour. Can it be deactivated?

Re: CSV File contains just field names

Posted: Thu Apr 24, 2025 12:00 pm
by sarnusch
I made a rollback of the server and checked the changelog:

Screenshot 2025-04-24 125541.png
Screenshot 2025-04-24 125541.png (8.07 KiB) Viewed 1652 times

In my opinion the improvement is not good.
I need the headers only if the query returns data. If there is no data the file should be empty. Or you should be able to choose whether the header is written even if the query is empty

Re: CSV File contains just field names

Posted: Tue Apr 29, 2025 11:23 am
by Oleg
Download fresh version.
We have added option to "SQL query to CSV file" action to disable file creation if query returns empty result.