Re: spooling a csv file from a table (problems)

From: MarkyG <markg_at_mymail.tm>
Date: Sat, 21 Jul 2001 21:52:13 GMT
Message-ID: <ab87195e.0106140406.5ceda71d_at_posting.google.com>


The good news is that you are able to enter your sql statement in sql*plus, do not put a ';' at the end of it. By pressing return twice, the statement is left in the buffer ready to run.
You then issue your spool c:\temp\stuff.csv command and the next line just type / .

The bad news is that you are left with a '/' at the top of your file. ;-( Better than an ugly sql statement anyway.

M

"Nicholas Mudie" <nmudie_at_chello.com> wrote in message news:<%ApU6.35399$2f1.2517347_at_amsnews02.chello.com>...
> Hello,
>
> I;m trying to spool the contents of a table to .csv format but when I do:
>
> SQLPLUS> set heading off
> SQLPLUS> set feedback off
> SQLPLUS> spool factors.csv
> SQLPLUS> select tstamp|| ',' ||pkg|| ','||prod from cfga.factors;
>
> spool off
>
> This runs fine and adds the records to the file but what happens is that the
> .csv file has this at the top
>
> SQLPLUS> select tstamp|| ',' ||pkg|| ','||prod from cfga.factors;
>
> ok, so I could VI to my file and take this out but I have huge files which
> vi can't cope with. There must be a spool command that ONLY writes the
> records to the file and not everything that you type.
>
> so, my question is...WHAT is the command which stops the sql statement being
> written to the file?
>
> Regards,
> Nicholas
> Chello
Received on Sat Jul 21 2001 - 23:52:13 CEST

Original text of this message