User`s guide

Using SQL*Plus in the POSIX environment
3-6 Oracle Database User's Guide
Running Shell Commands From SQL*Plus
Using an Editor in SQL*plus
3.5.1 Starting SQL*Plus
You can start SQL*Plus in the POSIX shell. Refer to "Starting Oracle Utilities in the
POSIX environment" for more information about running SQL*Plus in the POSIX
shell.
3.5.2 Running Shell Commands From SQL*Plus
The SQL*Plus
HOST
command enables you to enter a POSIX shell command, while you
are logged on to SQL*Plus.
Keep the following points in mind when using the HOST command:
If you enter the
HOST
command without any shell command, then it takes you to
the command level. To return to SQL*Plus, you must use the
exit
command in the
POSIX subshell.
If you enter the
HOST
command with a shell command, then the command is
executed and you return to SQL*Plus.
Use the
bs2cmd
POSIX shell command to execute BS2000 SDF commands.
3.5.3 Using an Editor in SQL*plus
Start a text editor in SQL*Plus with the
EDIT
command, if you want to edit an SQL
statement.
The default editor depends on the terminal connected with your POSIX session. If the
POSIX shell is started on a blockmode terminal, then the default editor in SQL*Plus is
set to
edtu
. If the POSIX shell is started by a remote X-client through
rlogin
or
ssh
using a xterm terminal, then the default editor in SQL*Plus is set to
vi
.
SQL*Plus provides the opportunity to define a preferred text editor with the
DEFINE _
EDITOR
command. In the POSIX environment you can define a preferred editor. For
example, if you want to define the editor, used by the
EDIT
command, to be the POSIX
editor
edtu
, then enter the following command in SQL*Plus:
DEFINE _EDITOR = edtu
Note:
The editor
vi
does not work on blockmode terminals.
The editor
edtu
does not work on xterm terminals.