Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Import/Export a delimited text file?
Gary YU wrote:
> Hi all,
>
> I'm new to Oracle, I just wondered, is there any tools that can export
> a table into delimited text file, or import a delimited text file from
> other source(excel, Informix...)?
>
> when I'm using imp/exp, I can't modify the dump file, and I have to
> DROP the table completely before I re-import it.
>
> any idea will be greatly appreciated.
>
> Thanks,
> Gary
Firstly, you *don't* need to drop the table before importing it. You could truncate it instead. However you are right that the pre-existence of a table causes import to throw a wobbly when it tries to do the 'create table' bits of the dump file... but then that's why they invented the IGNORE=Y parameter. It forces import to ignore errors arising from the fact that the table(s) already exist, and to just get on and do the insertion of data into said table(s).
Second, if you still want to output CSVs, then you need nothing more than SQL*Plus: select empno || ',' || ename || ',' || sal from emp;
You'll need to spool to a file first, of course, and spool off afterwards. You'll also want to switch column headers off and so on: set verify off, set feedback off, set header off, set trimspool on ... there are others, but that should get you started.
Regards
HJR
![]() |
![]() |