0

I am trying to query a Sybase using iSQL client and export the query results to a text file or CSV file with column name. However the column headings are not exported to the file. I tried below script it shows error message, below the working script without column heading and error script, appreciate any valuable advice.

working sql:

select * from siebel.S_ORG_EXT;  
OUTPUT TO 'C:\\Siebel SQLs\\Account.CSV' FORMAT TEXT 
DELIMITED BY ';' QUOTE ''

Not working sql :

select * from siebel.S_ORG_EXT;  
OUTPUT TO 'C:\\Siebel SQLs\\Account.CSV' FORMAT TEXT 
DELIMITED BY ';' QUOTE '' WITH COLUMN NAMES;
A. Kootstra
  • 6,331
  • 3
  • 17
  • 38
Matt
  • 1
  • 1
  • 4

3 Answers3

1

If you are using Sybase iAnywhere the WITH COLUMN NAMES option is not recognized by that Sybase product. Just thought I'd mention this for those like myself who have struggled with a similar issue.

HTH

tale852150
  • 1,533
  • 3
  • 16
  • 22
0

You can try following query:

SELECT * FROM siebel.S_ORG_EXT; OUTPUT TO 'C:\\Siebel SQLs\\Account.CSV' FORMAT ASCII DELIMITED BY ';' QUOTE '' WITH COLUMN NAMES;
Im0rtality
  • 3,354
  • 3
  • 29
  • 41
0

Alternatively you could use a different SQL client. For example Squirrel SQL which supports JDBC connections. In other SQL clients you will need to import the jconn2.jar which is part of your local web client installation.

A. Kootstra
  • 6,331
  • 3
  • 17
  • 38