I`m working with Vertica. I try to export data from SELECT query into csv. I tried making it with sql query:
SELECT * FROM table_name INTO OUTFILE '/tmp/fileName.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
I got an error:
[Vertica][VJDBC](4856) ERROR: Syntax error at or near "INTO"
Is there a way to export a query result to a csv file? I prefer not to use vsql, but if there no other way, I will use it. I tried the following:
vsql -c "select * from table_name;" > /tmp/export_data.txt
vsql -U dbadmin dwh -A -P footer=off -F ',' -c "SELECT 'Definitely not a valid csv, but who cares, right?' AS mycolumn;" | RESULT: | mycolumn Definitely not a valid csv, but who cares, right?
– Cytaster