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 -> Output from SQL*Plus to tab-separated file

Output from SQL*Plus to tab-separated file

From: PhilHibbs <snarks_at_gmail.com>
Date: Tue, 28 Aug 2007 15:53:46 -0000
Message-ID: <1188316426.246623.49290@50g2000hsm.googlegroups.com>


Is there an easy way to output the contents of a table as a tab- separated file from SQL*Plus? Currently I have something like this:

SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 4000
SET PAGESIZE 0
SET ECHO OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET MARKUP HTML OFF SPOOL OFF SET TERMOUT OFF
SPOOL Header.txt

SELECT         OBJECT_TASK_HEADER  -- VARCHAR2(1)

|| CHR(9) || CATEGORY -- VARCHAR2(1)
|| CHR(9) || GROUPING -- VARCHAR2(4)
|| CHR(9) || PARTNERTYPE -- VARCHAR2(4)
|| CHR(9) || AUTHORIZATIONGROUP -- VARCHAR2(4)
|| CHR(9) || CENTRAL_BLOCK -- VARCHAR2(1)
|| CHR(9) || TITLE_KEY -- VARCHAR2(4)
|| CHR(9) || PARTNEREXTERNAL -- VARCHAR2(20)
FROM header; This produces my output, but with redundant trailing spaces. Ideally I'd just like to turn off column padding and do a SELECT * on the table, but I can't see a way of doing that. I would rather not create separate SQL*Loader scripts for each table,
I'd rather do all the tables in a single SQL*Plus script.

Any ideas?

Phil Hibbs. Received on Tue Aug 28 2007 - 10:53:46 CDT

Original text of this message

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