Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to export table data to a text file?
Hi Zhou
On Thu, 20 Sep 2001 22:30:18 +0900, "Huiqun Zhou" <zhou_at_ra2.so-net.ne.jp> wrote:
>I'm a newbie for Oracle. Could anyone let me know how to export
>data of a table into a text file? Is exp the right tool?
If what you want to do is load the data back into another Oracle table (perhaps on a different database) then exp is the tool to use.
If what you want is to have a regular text file which can be read by other applications (a spreadsheet for example) investigate the use of the SPOOL command at the SQL*Plus prompt. This will direct a copy of the output you would normally see on the screen to a text file. Anything you can get on the screen will go to the file. Other SQL*Plus commands you will probably useful for this sort of thing are: SET HEADER, SET TRIMSPOOL, SET LINESIZE, SET PAGESIZE and SET FEEDBACK.
Information on the SPOOL command (and the other commands) can be found in the SQL*Plus manual (not the SQL Reference) as they are not part of the SQL standard.
Regards
Dale