Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Delimited Output

Re: Delimited Output

From: Conan Farrell <conan_at_(remove_this)as-if.com>
Date: 12 Oct 1999 15:42:43 +0100
Message-ID: <01bf14b8$02826060$b501ce0a@Cfarrell.snn.ie.sykes.com>


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')

/
spool off

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US