Re: sqlplus csv column headings

From: joel garry <joel-garry_at_home.com>
Date: Thu, 17 Jan 2008 13:34:25 -0800 (PST)
Message-ID: <60d468b1-0bc0-44ea-90a0-a7f8339add74@l32g2000hse.googlegroups.com>


On Jan 17, 6:35 am, burrell.j..._at_yahoo.com wrote:
> Hello,
> I am
> trying to generate csv file from the output of a sqlplus.
> 9i on unix.
> Dome quite well so far.
> spool wed.csv
> set colsep |
> set heading off
> set feedback off
> set linesize 4000
> set trimspool on
> set pagesize 0
>
> That colsep command is really useful BTW.
> Anyhow know how can I get the column heads just once?
>
> TIA
> J

Another way is to run another spool without pagesize 0 and a where clause that won't get rows, and put the two files together. If you know the number of lines is less than the maximum allowable pagesize, you could set pagesize to the number of rows+number of heading lines.

In my experience, having data with delimiters in it usually causes a lot more work no matter how you do it.

jg

--
@home.com is bogus.
"Never fly in the same cockpit with someone braver than you."
Received on Thu Jan 17 2008 - 15:34:25 CST

Original text of this message