sqlcsvexportquotesexasolution

EXASOL export to csv with quotes


I want to export a database-tab to csv-file with quotes arround any string (column separator is ";"). This is what I want as csv file (without header): "abc";"blabla"

When I export just with "Select * from...", no quotes surround the string: abc;blabla

When I export with "Select concate('"',column1,'"'), concate('"',column2,'"') from...", following content is given in csv-file: """abc""";"""blabla"""


Solution

  • You can use the EXPORT options

    COLUMN DELIMITER and DELIMIT to control how the data is exported - e.g.

    EXPORT RETAIL.ARTICLE 
    INTO LOCAL CSV FILE 'C:\TEMP\testexp1.csv' 
    ROW SEPARATOR = 'CRLF' 
    COLUMN SEPARATOR = ','
    COLUMN DELIMITER = '"'
    DELIMIT = ALWAYS;