1

I wish to export a two column table to CSV using the Oracle Spool. When I execute the export, the first column formats fine, the second column however spills over into a third column in XLS. The contents of the second column in the DB are quite long.

Below is what I am trying:

column MachineName Format a20;
column OperatorName Format a32000;
set colsep ,
set echo off
set feedback off
set heading on
set linesize 32000
set pagesize 0
set termout off
set trim off
set trimspool on
set array 100
set underline off
set wrap off
set flush off
set verify off
set embedded on

Below are the results. In this example, the "Lucio Victor" should be in the same column as "Revolo Borja". (In the DB, this is all in one column)

MACHINENAME         ,OPERATORNAME
CM101               ,Revolo Borja, Lucio Victor
CM101               ,Revolo Borja, Lucio Victor
CM101               ,Revolo Borja, Lucio Victor
CM101               ,Revolo Borja, Lucio Victor

Results should be

MACHINENAME         ,OPERATORNAME
CM101               ,Revolo Borja Lucio Victor
CM101               ,Revolo Borja Lucio Victor
CM101               ,Revolo Borja Lucio Victor
CM101               ,Revolo Borja Lucio Victor
1
  • for what it's worth, in SQLcl (still in beta), you can have your output automatically formatted to CSV. SQLcl is a new command line interface developed by the SQL Developer team Commented Jul 29, 2015 at 13:10

1 Answer 1

1

put " around your operatorname column, excel is reading the comma as a field delimeter

Sign up to request clarification or add additional context in comments.

1 Comment

I think I have just figured out why....but don't know how to fix. When I look at the raw data for that column it is like this:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.