The following commands can be issued in SQL*Plus commands.

@ pathname Run an SQL Script (see START)
@MyScript.sql parameter1 parameter2 parameter3
In the SQL-Script, refer to the parameters as &1, &2, and &3.

@@ pathname Run a nested SQL Script.
Execute (or re-execute) commands in the SQL*Plus buffer does not list commands before running
ACCEPT User input
APPEND Add text to the end of the current line in the buffer.
A[PPEND] text_to_add
BREAK Specify where and how formatting will change.
BREAK ON {column|expr|ROW|REPORT} action

BTITLE Place and format a title at the bottom of each page.
BTITLE printspec [text|variable]
CHANGE Change text on the current line.
C /oldval/newval

CLEAR Clear the SQL*Plus screen and the screen buffer.
COLUMN Change display width of a column.
COMPUTE Calculate and display totals.
CONNECT Connect to a database as a specified user.
connect username/password@SID
COPY Copy data from a query into a table (local or remote)
DEFINE User variables:
DEFINE <varName> = <String> Display a user variable
DEFINE <varName> Display all variables

DEFINE_EDITOR = sql*plus editor (e.g. DEFINE_EDITOR=vi)
DEL Delete the current line in the SQL buffer
DESC[RIBE] Describe a table, column, view, synonym, function
procedure, package or package contents.
DISCONNECT Logoff (but don’t exit)
EDIT Load the SQL*Plus buffer into an editor. By default, saves the file to AFIEDT.BUF
EXECUTE Run a single PLSQL statement
EXIT [n] Commit, logoff and exit (n = error code) e.g. EXIT SQL.SQLCODE
GET file Retrieve a previously stored command file
HELP topic Topic is an SQL PLUS command or HELP COMMANDS
HOST Execute a host operating system command
INPUT Edit sql buffer – add line(s) to the buffer

LIST n m Edit sql buffer – display buffer lines n to m For all lines – specify m as LAST
PAUSE message Wait for the user to hit RETURN
PRINT variable List the value of a bind variable (see VARIABLE / SHOW)
PROMPT message Echo a message to the screen
REMARK REMARK comment or –comment– or /* comment */
RUN Execute (or re-execute) commands in the SQL*Plus buffer Lists the commands before running
RUNFORM Run a SQL*Forms application
SAVE file Save the contents of the SQL*Plus buffer in a command file
SET Display or change SQL*Plus settings
SHOW List the value of a system variable (see PRINT)
SPOOL file Store query results in file
SPOOL OFF Turn off spooling
SPOOL OUT sends file to printer
SQLPLUS Start SQL*Plus and connect to a database.
STA[RT] Run an SQL Script (see @)
TIMING Record timing data TIMING START | SHOW | STOP
TTITLE Define a page title
UNDEFINE Delete a user variable or passed parameter
VARIABLE Define a bind variable (Can be used in both SQLPlus and PLSQL)
VAR[IABLE] [variable {NUMBER|CHAR|CHAR (n)}]
VARIABLE on its own will display the definitions made.
WHENEVER OSERROR Exit if an OS error occurs
WHENEVER SQLERROR Exit if an SQL or PLSQL error occurs

Leave a Reply

Your email address will not be published. Required fields are marked *