django
django

Reputation: 153

How to export csv file with SQL Developer with Pipe separator

I need to export a file in CSV format with a pipe | delimiter instead of a comma and without "" (double quotes) for string field from Oracle SQL Developer. I must use SQLPLUS. I try to execute (f5 button) with :

set colsep | spool C:\myFile.csv select * from mytable; spool off

but it returns always commas separator and double quotes.

Upvotes: 0

Views: 13418

Answers (1)

Hadrian
Hadrian

Reputation: 19

You can remove string enclosures in SQL Developer. There is a bug though. First overcome the bug: 1) Run a small statement like "select 1 abc from dual" (Ctrl+Enter). 2) Export it (right click on the results set) as delimited setting enclosures to "none" and separator to the charater of your choice.

Now type your query, starting with "set sqlformat delimited" (probably you want ot use spool as well) and run it as a script (F5).

It works :)

Hadrian

Upvotes: 0

Related Questions