Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: sql command for exporting data to ascii file
You can use the spool command to direct your output to a text file.
SQL> spool myfile.txt SQL> desc mytable SQL> SQL> SQL> select * from mytable; SQL> SQL> spool off
this opens myfile.txt for input
the desc mytable command outputs the structure of the table
the select * from mytable displays all data in the table
the spool off closes myfile.txt
You can then view myfile.txt with any text editor.
HTH,
Roy
In article
<0E16861EE7BCD111BE9400805FE6841F068DF428_at_c1s5x001.cor.srvfarm.origin-it.com>,
"Stefan den Engelsman" <Stefan.denEngelsman_at_nl.origin-it.com> wrote:
> Hello,
>
> Can anyone tell me if oracle does have a sql command which exports the
> contents of a table to an ascii file :
>
> for example :
>
> copy table test
> (
> field1 colon,
> field2 colon,
> field3 nl
> )
> into 'file';
>
> would result into :
>
> file :
> ---------------
> value1:value2:value3
> value1:value2:value3
> etc.
>
> Thanks in advance
>
>
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Tue Jan 26 1999 - 13:15:54 CST
![]() |
![]() |