Some handy settings when running a query from the command line via sqlplus
set echo off set heading on set linesize 1024 set pagesize 0 set tab on set trims on set wrap off
-- might want to set column formats here
-- e.g.: column foo format A10
spool stats -- dump results to stats.lst
-- SQL query here
spool off
exit
Another tip : use rlwrap with sql*plus
http://sysdba.wordpress.com/2006/10/08/how-to-use-rlwrap-to-get-a-command-history-in-sqlplus/
Instead of sqlplus you should try yasql, a much more civilized alternative to sqlplus. Yasql has gnu readline support, more flexible output, and lots more.
http://sourceforge.net/projects/yasql/
Hi Pat, thanks for the pointer – much nicer than sqlplus