Of Interest
Business Intelligence and Analytics
Oracle Training
|
Oracle
»
PL-SQL
»
SQL-Plus
»
Extract-File-Ou
Formatting Records for Output Files in SQL-Plus
SQL Plus was originally a reporting utility. Unfortunately, it is the only tool provided
by Oracle for generating flat files. To remove the 'friendly' formatting, here
are the commands required:
set echo off
set newpage 0
set pagesize 0
set space 0
set feedback off
set trimspool on
set heading off
set linesize 555
-- Then, to create a flat file, with pipe delimiters:
spool invoices.dat;
select invoice_id || '|' ||
invoice_dt || '|' ||
total_amt
from invoices
order by invoice_id
;
spool off;
exit
|
|
|
Get the latest Rocket99 news and tech tips via
|