Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: spooling csv file from table (problems)
"Nicholas Mudie" <nmudie_at_chello.com> wrote in message
news:gBpU6.35401$2f1.2516311_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
>
>
Place your commands in a sql script (know how to run a sql script?)
and you won't have this problem.
Also try reading the sqlplus reference manual or Oracle the Complete
reference.
Hth,
Sybrand Bakker, Oracle DBA Received on Sat Jun 09 2001 - 11:06:15 CDT
![]() |
![]() |