Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: using sqlldr to extract the content of table to a file
Thanks all for your help.
I tried this:
from dos:
SQLPLUSW.EXE scott/tiger_at_host @D:\script.sql
script.sql:
SET LINESIZE 2000
set colsep ,
spool D:\file.txt
select * from emp;
spool off;
exit
The result is odd, i have a header with the columns title separated by
commas then a line with ------ and then11 lines of data and again the header
and so on.
It seems also to be size delimited
EMPNO,ENAME ,JOB , MGR,HIREDATE , ----------,----------,---------,----------,---------, 7369,SMITH ,CLERK , 7902,17-DEC-80,
Is there a way to remove the header and the ---- separation? also to remove
this size delimitation?
in a way to have only:
7369,SMITH,CLERK,7902,17-DEC-80, Thanks
"gazzag" <gareth_at_jamms.org> wrote in message
news:1159355470.870247.152740_at_h48g2000cwc.googlegroups.com...
> Wilfrid wrote:
>> Hello,
>>
>> I am using Oracle 9.2.0.1.
>> I would like to extract the content of a table to a csv file. I am
>> already
>> using a bit sqlldr to load data into the DB and I was wondering if the
>> other
>> way around is possible?
>> Or may be there is another way/tool for doing this.
>> Thanks for your help
>> Wilfrid
>
>>From within SQL*Plus:
>
> SQL> set colsep ,
> SQL> spool <filename>
> SQL> select * from <table_name>;
> SQL> spool off
>
> HTH
> -g
>
Received on Mon Oct 02 2006 - 07:45:53 CDT
![]() |
![]() |