Matt
Matt

Reputation: 1

How to output data from iSQL to csv file with column names

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;

Upvotes: 0

Views: 9019

Answers (3)

A. Kootstra
A. Kootstra

Reputation: 6981

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.

Upvotes: 0

tale852150
tale852150

Reputation: 1638

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

Upvotes: 1

user5243170
user5243170

Reputation: 1

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;

Upvotes: 0

Related Questions