Re: Dump Ascii File From Oracle 6

From: Willard Coates <WDCOATES_at_PURCCVM.BITNET>
Date: Friday, 2 Dec 1994 09:39:18 EST
Message-ID: <94336.093919WDCOATES_at_PURCCVM.BITNET>


Jeff Gerth wrote:

>I'm trying to dump oracle table data to an comma delimited ascii file...
>I'm sure there has to be a convenient way of doing this, but I have yet
>to find it.... This is in the PC based version of oracle 6... any
>suggestions?
 

> J.G.

I use the following sqlplus creating sqlplus script for creating '|' delimited files - just change the first '''|''' to ''',''' and omit the second?

  • NAME: off.sql
  • _at_(#) Turn off everything that could corrupt output set timing off set time off set feedback off set heading off set echo off set pause off set verify off ttitle off btitle off
  • NAME: unload.sql
  • _at_(#) Create SQL for delimited dump of table _at_off spool tmp.sql select '_at_off' from dual; select lower('spool &xuserid..&xtable..data') from dual; select 'select' from dual; select column_name||'||'||'''|'''||'||' from user_tab_columns,user_tables where user_tables.table_name = '&xtable' and user_tables.table_name = user_tab_columns.table_name and column_id < (select max(column_id) from user_tab_columns where table_name = '&xtable') order by column_id; select column_name||'||'||'''|''' from user_tab_columns,user_tables where user_tables.table_name = '&xtable' and user_tables.table_name = user_tab_columns.table_name and column_id = (select max(column_id) from user_tab_columns where table_name = '&xtable'); select 'from &xtable;' from dual; select 'spool off' from dual; spool off; _at_tmp
Willard                ___________________________
______________________| Willard D. Coates         |__________________________
\  Phone:             | Engr. Admin. ENAD 1128    | wdcoates_at_cc.purdue.edu  /
 \    (317) 494-3900  | Purdue University         |                        /
  )  Fax:             | West Lafayette, IN 47907  |            \\///      (
 /    (317) 494-6480  |___________________________|            (o o)       \
/________________________)                     (____________oOO_(_)_OOo_____\
Received on Fri Dec 02 1994 - 15:39:18 CET

Original text of this message