Search code examples
t-sqlsybasesap-ase

query to output files in sybase ase


In this link , they said we can export data into a file. However they are using ASA( SQLAnywhere ) which is different then ASE, so is there a query similar to this

SELECT * FROM SomeTable;
OUTPUT TO 'C:\temp\sometable.csv' FORMAT ASCII DELIMITED BY ';' QUOTE ''

where we can run it on ASE ?


Solution

  • You must know that "output to" is a command only available in Interactive SQL. (you must run the isql client in order for it to work). Documentation here The syntaxt for ASE is:

    SELECT * FROM SomeTable
    GO
    OUTPUT TO 'C:\temp\sometable.csv' FORMAT ASCII DELIMITED BY ';' QUOTE ''