Re: How to dump table to field delimited ASCII file?
Date: 10 Sep 2001 19:37:10 -0700
Message-ID: <95cd51c.0109101837.36b8a2ae_at_posting.google.com>
Hi there,
Try the code below:
set trimspool on
set termout off pages 0 heading off echo off
set verify off feedback off
set line 130
spool emp.dat
select
'"' || replace(EMPNO,'"') ||'",' ||
'"' || replace(ENAME,'"') ||'",' ||
'"' || replace(JOB,'"') ||'",' ||
'"' || replace(MGR,'"') ||'",' ||
'"' || replace(HIREDATE,'"') ||'",' ||
'"' || replace(SAL,'"') ||'",' ||
'"' || replace(COMM,'"') ||'",' ||
'"' || replace(DEPTNO,'"') ||'"'
from scott.emp
/
spool off
Say you have few tables to be output, hardcode the fields is fine. Otherwise, you will have to be smarter namely grab the all the tables and all the fields and output to different files respectively.
Allan W. Tham
DBA
Received on Tue Sep 11 2001 - 04:37:10 CEST