Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

SQL query output to a CSV file

Hi,
I am working on an ETL job in which there is a table I query and have to write the rows returned by the query to a CSV file.
The issue is that the table which I query is created during the job execution because the columns to be included in the table are based on another query.
So the table structure may vary from execution to execution. Is there a way to output/write the rows generated from a "SELECT * FROM...." to a CSV file using a tFileDelimitedOutput component? 
The reason behind asking the question I would not able to define a schema for the output file that is to be created because of the dynamic structure of the table.
Labels (3)
1 Reply
vapukov
Master II
Master II

this way named - welcome to subscription version 0683p000009MACn.png
Simplest case as described could be also realised by SQL
example in MySQL
SELECT CONCAT_WS(';','col1_name','col2_name', ... , 'colx_name')
UNION
SELECT CONCAT_WS(';',col1,col2,...., colx)

than You define source and target schema as only single column type string