HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

How to erase in sqlplus with backspace?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
howwitherasebackspacesqlplus

Problem

Using SQL*PLUS, I cannot use the backspace button to erase content during a line command.

When I hit backspace, instead of erasing it writes ^H

Is there a way to configure backspace so it works as intended ?

Solution

If you're using Linux/Unix, there's a way of making SQL*Plus loads friendlier on the command line - use rlwrap. It adds readline support to SQLPlus, allowing you to use the cursor keys to navigate to previous queries (it retains a history), and edit them when you've made a mistake.

Launch SQL*Plus with rlwrap -i sqlplus or add alias sqlplus="rlwrap -i sqlplus" to your shell dot file (.bashrc/.cshrc/etc).

To install rlwrap on RHEL 5.0 use the following commands:

wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
yum install rlwrap
rlwrap –i sqlplus

Code Snippets

wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
yum install rlwrap
rlwrap –i sqlplus

Context

StackExchange Database Administrators Q#116330, answer score: 5

Revisions (0)

No revisions yet.