Wednesday, January 18, 2012

How to show only one header in sqlplus

When you have to use sqlplus and want to avoid showing table header each n rows returned, you can use the command bellow to show only one header:


set pagesize 0   -- only one header row

Another useful commands:
set colsep ,     -- separate columns with a comma
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

sqlplus reference: http://psoug.org/reference/sqlplus.html
How to create a csv file from sqlplus output: http://stackoverflow.com/questions/643137/how-do-i-spool-to-a-csv-formatted-file-using-sqlplus


No comments:

Post a Comment