in reply to Re: extract string columns with perl
in thread extract string columns with perl

Hi, I tried to format already the sql, but I am a bit limited, since I need to get the columns in a certain order like: select column2, column4, column1, etc... from table; and then spool this into a csv file

configurations in sql session before spooling are as this: set feedback off

set heading on

set FEEDBACK off

set verify off

set numwidt 20

set echo off

SET TERMOUT OFF

set linesize 10000

set pagesize 0

Not sure if I can do anything else to help with the format? Thanks!

Replies are listed 'Best First'.
Re^3: extract string columns with perl
by Laurent_R (Canon) on Apr 16, 2014 at 08:41 UTC
    Well, I am using something similar (although not sure for every detail). One additional statement you could use to get a CSV is:
    set colsep ,
    Also, you may want to use the trim function in your select statement.
      Nice one thanks for the hint. I checked the oracle linesize limit and set it to 32767 which is the max.

      Looks to help with the csv file format and now I sorted it.

      Thanks to all!