Favorite SQL*Plus tips and tricks [closed]

You can use rlwrap to add readline support to sqlplus. Run sqlplus like this:

$ rlwrap -c sqlplus username@database

Now up/down will scroll through command history. Use ctrl-r to search backwards through history, etc. This makes sqlplus bearable.

Also, add this to your login.sql to set the linesize to whatever the width of your terminal is:

HOST echo "set linesize" $(stty -a|head -n1|cut -f7 -d' '|cut -f1 -d';') > .tmp.sql
@.tmp.sql
HOST rm -f .tmp.sql

Both of these tips only work on unix.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)