Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle Server 7.3 table to .CSV file dump
REM ===========================================================REM
REM ===========================================================set echo off
,'DATE', ') || chr(&3) || '
,'CHAR' , ',chr(&3),chr(126) )) || chr(&3) ||'
,'VARCHAR2', ',chr(&3),chr(126) )) || chr(&3) ||'
,' || chr(&3) || ' ) from all_tab_columns
where table_name = upper('&2') and owner = upper('&1')
and data_type not in ('LONG','LONG RAW');
REM
REM Remember that we concatenated an extra "||" on the end
REM of the last column. Can't leave it hanging, so put
REM another delimiter on the end to fix the statement's syntax.
REM
select 'chr(&3))' from dual;
REM
REM Now, tack on the predicate...
REM
select 'from &1' || '.' || '&2;' from dual; spool off
REM Done with extract statement. Wanna see it?
set termout on
get cmd.sql
prompt prompt Hit any key to start export, or <ctrl>-c to cancel
accept keypress
prompt
prompt Now exporting table: owner = &1 prompt table name = &2 , prompt delimited by ASCII(&3)set termout off
![]() |
![]() |