Set SQL*PLUS

SQLPROMPT

&_user : Who is connected (10g and +).
&_CONNECT_IDENTIFIER : Which Database you are connected.

Eg:
SQL>
set sqlprompt  '&_CONNECT_IDENTIFIER@&_user>'
PADOVA@SYS>


TRIMSPOOL – TRIMOUT

SET TRIMOUT ON or SET TRIMSPOOL ON removes trailing blanks at the end of each displayed or spooled line.

SQL> set lin 80
SQL> set TRIMSPOOL OFF
SQL> spool prueba04.txt
SQL> select '12345' cmp from dual;
cmp
-----
12345
SQL>  spool off;
bash-3.2$  wc -c prueba04.txt
       293 prueba04.txt <----- 293 characters

SQL> set lin 80
SQL> SET TRIMSPOOL ON
SQL> spool prueba02.txt
SQL>  select '12345' cmp from dual;
cmp
-----
12345
SQL>  spool off;
bash-3.2$ wc -c prueba02.txt
       69 prueba02.txt    <----- just 69 characters



GLOGIN.SQL

$ORACLE_HOME/sqlplus/admin/glogin.sql

All SQL*PLUS will execute every statements into this file "glogin.sql". This help you set something like linesize, sql prompt  across SQLPLUS sessions.

Comments