Name SET NUMFORMAT Synopsis The NUMFORMAT setting specifies the default formatting of numeric values returned from a SELECT statement. Any number format usable with the COLUMN command may also be. Selection from Oracle SQL.Plus: The Definitive Guide, 2nd Edition Book.
I'm using SQL*Plus to spool a table to a csv file, but the default setting is to extract using fixed width. Each column fills the length with extra spaces which is not contained in DB tables. We need to use select * because the column is dynamic so ?,?||column||?,? method is not available.
In the database:
Extracted as:
We want it as:
Our settings:
set colsep ','
set echo off
set feedback off
set termout off
set linesize 32766
SET newpage none
SET verify off
SET term off
SET trims ON
SET trimspool ON
set underline off
select * from table_1;