I just found “gqlplus”:http://gqlplus.sourceforge.net today when looking for a way to enable command-line history in the SQL*Plus command that comes with Oracle’s “Instant Client”:http://www.oracle.com/technology/tech/oci/instantclient/index.html:
bq. _gqlplus_ is a drop-in replacement for sqlplus, an Oracle SQL client, for UNIX and UNIX-like platforms. The difference between _gqlplus_ and sqlplus is *command-line editing and history, plus table-name and column-name completion*. As you know if you have used sqlplus, it is notoriously difficult to correct typing errors and other mistakes in your SQL statements. sqlplus does give you ability to use external editor to edit a statement, but only the last statement you typed. _gqlplus_ solves this problem by providing the familiar command-line editing and history as in tcsh or bash shells, and table/column-name completion, while otherwise retaining compatibility with sqlplus.
To install on OS X, simply “download”:http://sf.net/projects/gqlplus, untar and do the usual configure/make ritual, with @–disable-shared@ passed to configure (see “this page for details”:http://log.antiflux.org/grant/2006/10/02/compiling-gqlplus-on-os-x but note that it’s no longer necessary to patch gqlplus):
$ ./configure --disable-shared
and then move the binary to “/usr/local/bin”:http://hivelogic.com/articles/2005/11/29/using_usr_local. You may want to pass @-d@ to gqlplus, to disable column-name completion, as it can take quite a while to load the meta data required, but otherwise gqlplus is truly a joy to use.
If you want to substitute all calls to sqlplus with gqlplus, add an alias to your .profile (or .bash_profile):
alias sqlplus='gqlplus' # with auto-completion
alias sqlplus='gqlplus -d' # without auto-completion