Re: sqlplus csv column headings

From: <burrell.john_at_yahoo.com>
Date: Thu, 17 Jan 2008 10:44:04 -0800 (PST)
Message-ID: <ac99705c-5f54-44bd-855d-a4a179a8ccde@n20g2000hsh.googlegroups.com>


On 17 Jan, 14:45, Mark D Powell <Mark.Pow..._at_eds.com> wrote:
> On Jan 17, 9: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
>
> To get the column headings you could select them as constants from
> dual or select them from dba_tab_columns and union this to your query
> to get the data.
>
> The problem with using colsep instead of concatenating the columns is
> that you get a fixed format file which takes more space than
> concatenated column lists.  With large tables the difference in
> approaches can result in significantly different OS file size
> requirements.
>
>  How do I export a database table to a flat file ?
>        http://www.jlcomp.demon.co.uk/faq/flatfile.html
>
> HTH -- Mark D Powell --- Hide quoted text -
>
> - Show quoted text -

thanks! Received on Thu Jan 17 2008 - 12:44:04 CST

Original text of this message