Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Delimited Output
This is the script I use
set head off
set pages 0
SELECT '&&TAB' FROM DUAL; spool dumpfile.sql
select
decode(rownum,1,'Select ',null), c.column_name, decode(rownum,p.maxc,'from &&tab ;','||'',''||') from user_tab_columns c, (select count(*) maxc from user_tab_columns where table_name=upper('&&tab')) p where table_name=upper('&&tab')
set head on
SET TERM OFF
set LINES 30000
SET TRIMSPOOL ON
SPOOL &&TAB..TXT
@dumpfile.sql
SPOOL OFF
SET TERM ON
undef tab
--
Conan Farrell
Oracle DBA
Received on Tue Oct 12 1999 - 09:42:43 CDT
![]() |
![]() |