Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Output from SQL*Plus to tab-separated file
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)I'd rather do all the tables in a single SQL*Plus script.
|| 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,
Any ideas?
Phil Hibbs. Received on Tue Aug 28 2007 - 10:53:46 CDT