How to export query results to a local CSV file

  1. Install SQream ODBC driver as described in http://docs.sqream.com/latest/manual/connector_odbc_linux.html
  2. Store your query in a file.
    The query must be in a single line and the last line of the file should be blank.
  3. Run the following command
    isql yourDSN <SqlQueryFileName -b -d"FieldDelimiter" >OutputCsvFileName
    -b = remove header (If you do not want the SQream column names in the CSV file)
    -d = specify the requested field delimiter character
    See this isql guide for additional options.

Example:

isql sqreamOn251 </home/sqream/test.sql -b -d"," >output.csv

  • 143
  • 22-Nov-2018
  • 279 Views