I just installed Oracle Express on Ubuntu 11.10. Then I tried using SQL*PLUS by running the query "select * from hr.employees;". But the output was a mess. Can anyone help me with formatting the output?
Besides, I want this to be a permanent change not just for the current session.
This is how it looks after I ran the query "select * from hr.employees;"
Set off with a wider console using SET LINESIZE 180. Then add few useful settings like SET PAGES 50000 for having headers printed only once every 50k rows, SET TAB OFF to prevent replacing of multiple spaces with tab characters plus SET TRIMOUT ON and SET TRIMSPOOL ON to get rid of trailing spaces at line ends.
To format individual columns use column clause:
column first_name format a20
column last_name format a20
column email format a30
Finally, to make these persistent, place them in either site global configuration script under $ORACLE_HOME/sqlplus/admin/glogin.sql or local one at ~/login.sql.