You can translate the question and the replies:

Create an empty csv file if a query returns any results

Hi Denodo Team, I have a job on the scheduler server running a query, and creating a CSV file with the result of the query. But, in case of a specific field contains NULL values, then the file should be generated as empty. Wthat I have done is to split current job in two ones: - The first one generates the file as before...I have added on the Where clause "and FIELD is not null". - The second one is the opposite, it should create a file in case that "FIELD IS NULL" but, it writes into the file all the rows containing this field populated as null. My question is...Is there any way to generate just an empty file, without writing anything in it, in the second scenario? I would need just to create an empty file, with no data in it in case of nulls... is it feasible? Thanks in advance.
user
02-12-2019 11:53:18 -0500

2 Answers

Hi, To generate an empty CSV file from a Scheduler job that returns NULL values, I performed the following: 1. In the Scheduler Administration Tool, navigate to the job. 2. Go to the "Exporters" section, and under the CSV exporter, enable the "Create file even if no tuples are exported" option. 3. Save and execute the Scheduler job to get the desired results. You can read the [Postprocessing Section (Exporters)](https://community.denodo.com/docs/html/browse/7.0/scheduler/administration/creating_and_scheduling_jobs/configuring_new_jobs/postprocessing_section_exporters) section of the Scheduler Administration Guide for more information on this topic. Hope this helps!
Denodo Team
02-12-2019 20:56:55 -0500
Hi mates, the point is that I don't want to generate a file ALWAYS, I just want to generate an empty file only in case that the query returns anything (rownum >=1). Is there any way to generate an empty file in that scenario? Thanks in advance.
user
03-12-2019 02:59:03 -0500
You must sign in to add an answer. If you do not have an account, you can register here