Oracle: To spool to CSV

 set colsep , -- separate columns with a comma

set pagesize 0 -- No header rows
set trimspool on -- remove trailing blanks
set headsep off -- this may or may not be useful...depends on your headings.
set linesize X -- X should be the sum of the column widths
set numw X -- X should be the length you want for numbers (avoid scientific notation on IDs)

spool myfile.csv

select table_name, tablespace_name
from all_tables

Comments

Popular posts from this blog

Oracle: To clean up WRI$_ADV_OBJECTS