SQL*Plus
Reference
C
A P P E N D I X
✦ ✦ ✦ ✦
1006 Appendixes
If you need to embed quotes within a quoted string, you can either double them up
or use different quotes inside and outside the string. For example:
The first example uses double quotes to enclose the string, which allows single
quotes to be used inside the string. The second example uses single quotes to
enclose the string, which means that a double single quote (‘’) is used inside the
string to represent one single quote.
This command prompts you to enter a date in the month, day, and year format
commonly used in the U.S. You can use a number of date format elements in a
format specification. See Table B-2 in Appendix B, “SQL Built-in Function
Reference,” for a complete list.
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1007
Table C-1
SQL*Plus Numeric Format Elements
Element Sample Description
Continued
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1008
1008 Appendixes
You can use the elements listed in Table C-1 with the COLUMN command to format
numeric output. Consider these examples:
The first example formats the ID_NO column to display in a five-digit-wide field. The
second example performs the same task for the TANK_NO column, but with the
added requirement that leading zeros be used. In both cases, SQL*Plus will leave
one space in front of the number for possible negative signs.
@
You use the @ command to execute a SQL*Plus script file. Following is its syntax:
filename The name of the file that you want to execute. The file name
may optionally include a directory path and an extension. The
default extension is .sql. If no path is specified, SQL*Plus will
look in the current working directory for the file. If it’s not
found there, SQL*Plus will then search the directories listed in
the SQLPATH environment variable.
arg An argument that you want to pass to the script. You can have
as many arguments as you like. They must be separated from
each other by at least one space, and they may optionally be
enclosed within quotes.
SQL> @create_user
To execute the same file and pass a username as an argument, enter the following:
@@
You can use the @@ command from within one SQL*Plus script to invoke another.
SQL*Plus will begin searching for the second script in the directory containing the
first. If you have two scripts in the same directory and one calls the other, you
should use the @@ command. Otherwise, if you have another script in the SQLPATH
with the same name, you could run into problems. Following is its syntax:
1010 Appendixes
filename The name of the file that you want to execute. The file name
may optionally include a directory path and an extension. The
default extension is .sql. If no path is specified, SQL*Plus will
look in the directory containing the current script. If you
execute @@ interactively, it functions just like @.
arg An argument that you want to pass to the script. You can have
as many arguments as you like. They must be separated from
each other by at least one space, and they may optionally be
enclosed within quotes.
@@create_user_2
/
The / command executes the SQL statement currently in the buffer. The buffer
always contains the most recent SQL statement or PL/SQL block that you have
entered or executed.
Note Use the L command to display the statement currently in the buffer.
In the following example, the L command is used to list the contents of the buffer,
and the / command is then used to execute those contents.
SQL> L
1* SELECT USER FROM DUAL
SQL> /
USER
------------------------------
SYSTEM
ACCEPT
The ACCEPT command interactively prompts the user for input and accepts a
response. Following is its syntax:
Note Avoid complicated date and numeric formats. This feature is poorly implemented,
and specifying a complex format can result in a catch-22 situation where nothing
that you enter is accepted. Try accepting a number using a format of $999. You’ll
see that no matter how you attempt to enter a number, it won’t be accepted.
In this next example, ACCEPT is used to prompt for a numeric value. The format
string $999 is used. The result is that nothing passes validation.
1012 Appendixes
If you use format strings with numbers, stick with simple formats made up of “9”s
and “.”s.
APPEND
The APPEND command appends text to the end of the current line of the SQL buffer.
Following is its syntax:
A[PPEND] text
The example in Listing C-1 shows a SQL statement being entered, listed, and
modified using the APPEND command. Note that APPEND may be abbreviated to A.
It’s difficult to see on paper, but two spaces are used following the A to get one
space between the words SELECT and USER.
ARCHIVE LOG
The ARCHIVE LOG command allows you to start and stop archiving from SQL*Plus.
This command also allows you to view current information about archiving and to
initiate the manual archiving of log files.
Note You must be logged on as SYSDBA, SYSOPER, or INTERNAL to use this command.
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1013
The following example shows the current state of archiving being displayed and
then shows automatic archiving being stopped:
ATTRIBUTE
The ATTRIBUTE command allows you to specify the display format for an attribute
of an object column. Following is its syntax:
1014 Appendixes
Listing C-2 shows how the ATTRIBUTE command is used to control the display
width of the ID_NO and TANK_NO attributes.
2 rows selected.
Notice that in the second set of results, after the ATTRIBUTE commands were
issued, both columns displayed five digits wide with leading zeros.
BREAK
The BREAK command allows you to define report breaks. Following is its syntax:
element := {column_name|expression|ROW|REPORT}
Note If you define column aliases in your SQL query, then use those aliases as column
names in the BREAK command.
The most common use of BREAK is to eliminate repeating values from a column.
Consider the example shown in Listing C-3.
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1016
1016 Appendixes
TANK_NO ANIMAL_NAME
--------- ------------------------------
1 Flipper
1 Skipper
1 Bopper
2 Batty
2 Shorty
2 Squacky
2 Paintuin
3 Nosey
3 Rascal
3 Snoops
10 rows selected.
TANK_NO ANIMAL_NAME
--------- ------------------------------
1 Flipper
Skipper
Bopper
2 Batty
Shorty
Squacky
Paintuin
3 Nosey
Rascal
Snoops
10 rows selected.
The BREAK command can also be used to skip a line between each group of animals,
as shown in Listing C-4.
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1017
TANK_NO ANIMAL_NAME
--------- ------------------------------
1 Flipper
Skipper
Bopper
2 Batty
Shorty
Squacky
Paintuin
3 Nosey
Rascal
Snoops
10 rows selected.
Notice that each time the tank number changes, a line is skipped. The BREAK
command defining this behavior contains two break actions. Even though it is a
default action, NODUPLICATES is included so that you can see how multiple actions
are specified.
Note When you define a column break, always make sure that the query results are
sorted by the break column.
BTITLE
The BTITLE command defines a footer (bottom title) that appears at the bottom of
each page of a report. Following is its syntax:
1018 Appendixes
|R[IGHT]
|BOLD
|FORMAT format}
text Specifies text that you want to appear as part of the title.
user_var Specifies the name of a user variable, the contents of
which will appear in the title. This may also be one of
the following predefined user variables: SQL.LNO for the
current line number, SQL.PNO for the current page
number, SQL.RELEASE for the current Oracle release
number, SQL.SQLCODE for the current error number, and
SQL.USER for the current username.
COL col_num Indents to the specified column.
SKIP lines Skips the specified number of lines.
LEFT Causes subsequent text to appear left-justified in the
current line.
CENTER Causes subsequent text to appear centered in the
current line. Note that the definition of center is
controlled by the SET LINESIZE command.
RIGHT Causes subsequent text to appear flush right. Note that
the SET LINESIZE command also defines the right edge
of the line.
BOLD Causes text to be printed three times in succession, on
three different lines.
FORMAT format Specifies a display format to use for subsequent text or
numeric values. See the earlier section “SQL*Plus
Display Formats” for details on specifying format strings.
OFF Turns the page footer off.
ON Turns the page footer on.
Note The hyphen in SQL*Plus is a line continuation character. When used, it must be
preceded by a space.
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1019
Page 1 Confidential
Payroll Department
You can use the BTITLE command with no arguments to see the current title
setting, as shown in this example:
SQL> BTITLE
btitle ON and is the following 102 characters:
LEFT ‘Page’ FORMAT 999 sql.pno RIGHT ‘Confidential’ SKIP 1
CENTER ‘Payroll Department’
CHANGE
The CHANGE command allows you to perform string substitution on the current line
of the SQL buffer. Following is its syntax:
C[HANGE] /old_text/new_text/
In the following example, a query is entered with the wrong column name in the
SELECT list. The L command is used to list the first line, and the column name is
replaced.
1020 Appendixes
CLEAR
The CLEAR command allows you to erase various types of SQL*Plus settings.
Following is its syntax:
CL[EAR] {BRE[AKS]
|BUFF[ER]
|COL[UMNS]
|COMP[UTES]
|SCR[EEN]
|SQL
|TIMI[NG]
COLUMN
The COLUMN command formats columns for display on a report. Listing C-5 shows
its syntax.
FOLD_A[FTER]|
FOLD_B[EFORE]|
FOR[MAT] format|
HEA[DING] heading_text|
JUS[TIFY] {LEFT|CENTER|CENTRE|RIGHT}|
LIKE source_column_name|
NEWL[INE]|
NEW_V[ALUE] user_var|
NOPRI[NT]|
PRI[NT]|
NUL[L] null_text|
OLD_V[ALUE] user_var|
ON|
OFF|
WRA[PPED]|
WOR[D_WRAPPED]|
TRU[NCATED]}
1022 Appendixes
The following example shows the COLUMN command being used to set the display
format and headings for two columns:
Animal ID Name
--------- ----------
100 Flipper
105 Skipper
112 Bopper
151 Batty
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1023
COMPUTE
The COMPUTE command allows you to define summaries for SQL*Plus to compute
and display. Following is its syntax:
Table C-2
Functions You Can Use with COMPUTE
Function Name Description
1024 Appendixes
Note The COMPUTE and BREAK commands work together. You can have only one COM-
PUTE setting for a database.
The example shown in Listing C-6 uses the COMPUTE command to print a count of
the animals in each tank.
TANK_NO ANIMAL_NAME
--------- ------------------------------
1 Flipper
Skipper
Bopper
********* ------------------------------
Count 3
2 Batty
Shorty
Squacky
Paintuin
********* ------------------------------
Count 4
3 Nosey
Rascal
Snoops
********* ------------------------------
Count 3
For COMPUTE to work, you must BREAK on the column listed in the ON clause of the
COMPUTE command. You should also sort the results of your query based on that
same column. Note that the label ‘Count’ is displayed in the column preceding the
one being counted. Oracle determines the preceding column based on the order in
the select list. If the previous column is defined as NOPRINT, then you won’t see the
compute label.
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1025
CONNECT
You use the CONNECT command to connect to a database from SQL*Plus. Following
is its syntax:
CONN[ECT] [[username[/password][@service]]
[AS {SYSOPER|SYSDBA}] [INTERNAL]]
The following example shows how to connect normally using the SYSDBA role:
If you omit your password, SQL*Plus will prompt you for it, as follows:
COPY
The COPY command allows you to copy data from one table to another table. The
tables may be in different databases. Following is its syntax:
login := username/password@service
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1026
1026 Appendixes
The example in Listing C-7 shows the COPY command being used to copy the ID_NO
and ANIMAL_NAME columns of the AQUATIC_ANIMAL table to a new table in a remote
database.
DEFINE
The DEFINE command allows you to create a SQL*Plus user variable and assign it
a value. The DEFINE command also allows you to list the values of all currently
defined user variables. Following is its syntax:
variable The name that you want to give the user variable that you are
defining
text The text string that you want to assign to the variable
The following examples show how to use the DEFINE command to define some user
variables and then to display their definitions:
Using DEFINE with just a variable name causes SQL*Plus to display the value of the
named variable. Using DEFINE by itself causes SQL*Plus to display the value of all
user variables.
DEL
The DEL command deletes one or more lines from the SQL buffer. Following is its
syntax:
beg The line number of the first line that you want to delete.
end The line number of the last line that you want to delete.
* The currently selected line. This may be used for either the
beginning or end of the range.
LAST The last line in the buffer.
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1028
1028 Appendixes
The example in Listing C-8 shows various ways to use the DEL command.
The first delete gets rid of lines 2 through 4. The second delete gets rid of the
current line, which happens to be the last line.
DESCRIBE
The DESCRIBE command displays information about the columns in a table.
Following is its syntax:
DESC[RIBE] [schema.]object[@dblink]
The following example shows the DESCRIBE command being used to display the
structure of a table:
DISCONNECT
The DISCONNECT command disconnects you from a database. Following is its
syntax:
DISC[CONNECT]
There are no parameters for this command. The DISCONNECT command is used as
follows:
SQL> DISCONNECT
Disconnected from Oracle8i Release 8.1.5.0.0 - Production
With the Partitioning and Java options
PL/SQL Release 8.1.5.0.0 - Production
EDIT
The EDIT command invokes an external text editor and allows you to use it to edit
the contents of the SQL buffer. The EDIT command also allows you to edit the
contents of a text file. Following is its syntax:
ED[IT] [filename]
SQL> EDIT
In most environments, this results in the full screen editor being invoked that
operates outside the bounds of the SQL*Plus session.
Note You can specify the editor to be invoked by defining a user variable named
EDITOR. SQL*Plus invokes the editor that the EDITOR user variable points to. For
example, to have SQL*Plus invoke the vi editor, execute the command DEFINE
EDITOR=vi.
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1030
1030 Appendixes
EXECUTE
The EXECUTE command allows you to execute a single PL/SQL statement. Following
is its syntax:
EXEC[UTE] statement
The following example illustrates how you can use the EXECUTE command:
EXIT
The EXIT command terminates your SQL*Plus session. Following is its syntax:
EXIT [SUCCESS|FAILURE|WARNING|number|user_var|:bind_var]
[COMMIT|ROLLBACK]
SQL> EXIT
GET
The GET command loads the contents of a text file into the SQL buffer. Following is
its syntax:
You can use the SAVE command to write the contents of the buffer to a file.
HELP
In some environments, the HELP command will get you help on SQL*Plus
commands. For this to work, you must also install the SQL*Plus help tables in your
database. Following is the HELP command’s syntax:
HELP topic_name
Note The HELP command isn’t available from the Windows NT version of SQL*Plus.
HOST
The HOST command allows you to execute an operating system command from
within SQL*Plus. Following is its syntax:
HO[ST] [command]
1032 Appendixes
SQL> host
Microsoft(R) Windows NT(TM)
(C) Copyright 1985-1996 Microsoft Corp.
Directory of C:\
C:\> exit
INPUT
The INPUT command allows you to add one or more new lines of text to the SQL
buffer. The lines are added following the current line. Following is its syntax:
I[NPUT] [text]
text A line that you want to insert. If you supply this argument, then
only this one line is inserted. Otherwise, you may insert as many
lines as you like.
SQL> L
1 SELECT animal_name
2* ORDER BY animal_name
SQL> 1
1* SELECT animal_name
SQL> I
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1033
2i FROM aquatic_animal
3i
SQL> L
1 SELECT animal_name
2 FROM aquatic_animal
3* ORDER BY animal_name
LIST
The LIST command lists all or part of the SQL buffer. Following is its syntax:
SQL> L 2 3
2 animal_name
3* FROM aquatic_animal
SQL> L
1 SELECT id_no,
2 animal_name
3 FROM aquatic_animal
4* ORDER BY animal_name
The LIST command with no arguments causes SQL*Plus to display all lines in the
buffer.
PASSWORD
The PASSWORD command allows you to change your Oracle password. It also allows
you to change the password of another user, but only if you have the ALTER USER
system privilege. Following is its syntax:
PASSW[ORD] [username]
username The name of the user whose password you want to change
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1034
1034 Appendixes
When you issue the PASSWORD command, SQL*Plus will prompt you for the new
password. For example:
SQL> PASSWORD
Changing password for SEAPARK
Old password: *******
New password: ******
Retype new password: ******
Password changed
PAUSE
The PAUSE command displays a line of text and waits for you to press the Enter key.
Following is its syntax:
PAU[SE] text
The following example shows you how to use the PAUSE command:
You can use the PAUSE command in scripts as a way to let the user know what’s
going to happen next.
PRINT
The PRINT command displays the contents of a bind variable. The PRINT command
with no arguments displays the contents of all bind variables. Following is its
syntax:
The following example shows a bind variable being declared, initialized with data,
and then displayed using the PRINT command:
SQL> PRINT x
X
---------
11
PROMPT
The PROMPT command displays a line of text on the screen. Following is its syntax:
PRO[MPT] text
QUIT
See the EXIT command. QUIT is synonymous with EXIT.
RECOVER
The RECOVER command is used to initiate database recovery. Its syntax is shown in
Listing C-10.
Continued
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1036
1036 Appendixes
REMARK
The REMARK command allows you to embed comments within a SQL*Plus script.
Following is its syntax:
REM[ARK] [comment]
Note You can also add comments to scripts by using the double-hyphen (--) or by
using /*...*/.
REPFOOTER
The REPFOOTER command allows you to define a report footer that prints on the
last page of a report. Following is its syntax:
1038 Appendixes
D
-
X
End of Report
Note The report footer will actually print just prior to the final page footer (BTITLE) for
the report.
REPHEADER
The REPHEADER command allows you to define a report header that prints on the
first page of a report. Following is its syntax:
|FORMAT format}
ANIMAL_NAME
------------------------------
Flipper
Skipper
Bopper
End of Report
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1040
1040 Appendixes
Note The report header will print just after the first page header (TTITLE).
RUN
The RUN command lists and executes the SQL statement or PL/SQL block currently
in the SQL buffer. Following is its syntax:
R[UN]
This command has no parameters. The following example illustrates the use of the
RUN command:
SQL> L
1 SELECT USER
2* FROM dual
SQL> R
1 SELECT USER
2* FROM dual
USER
------------------------------
SEAPARK
SAVE
The SAVE command writes the contents of the SQL buffer to a file. Following is its
syntax:
filename Specifies the name of the file to which you want to write the
contents of the SQL buffer. The default extension is .sql.
CREATE Creates a new file and causes the command to fail if the file
already exists.
REPLACE Creates a new file or replaces the file if it already exists.
APPEND Appends the buffer contents to the end of the file.
You can find the SQL statement in the file named list_animals.sql in the c:\a
directory.
SET
The SET command changes a setting that controls how SQL*Plus operates. A large
number of settings have been added over the years that allow you to closely
control certain aspects of SQL*Plus’ behavior. Its syntax is shown in Listing C-11.
Continued
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1042
1042 Appendixes
The syntax elements for the SET command are shown in Table C-3.
Table C-3
Syntax Elements for the SET Command
Element Description
Element Description
Continued
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1044
1044 Appendixes
Element Description
Continued
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1046
1046 Appendixes
Element Description
Continued
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1048
1048 Appendixes
SHOW
The SHOW command displays the current value of a SQL*Plus setting. Following is
its syntax:
SHO[W] [option|ALL]
option Any setting that you can set using the SET command
ALL A keyword causing SQL*Plus to list the values of all settings
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1049
The first example shows the value of one setting, the LINESIZE setting. The second
example shows the value of all settings. The resulting list is quite long.
SHUTDOWN
The SHUTDOWN command shuts down a database. You must be connected as
INTERNAL, SYSDBA, or SYSOPER to use this command. Following is its syntax:
SHUTDOWN [NORMAL|IMMEDIATE|TRANSACTIONAL|ABORT]
1050 Appendixes
SPOOL
The SPOOL command allows you to send SQL*Plus output to a file. Following is its
syntax:
SPO[OL] [filename|OFF|OUT]
filename Specifies the name of the file to which you want to write
the output. Spooling starts immediately after you issue a
command specifying a spool file name. The default file
extension is operating-system-specific, but it is usually
.lis or .lst.
OFF Stops the writing of output to the spool file and closes the file.
OUT Does the same thing as OFF, but also prints the file. However,
in Windows environments, this option functions exactly
like OFF.
SQL> SPOOL
not spooling currently
SQL> SPOOL c:\a\animal_report
Issuing the SPOOL command with no arguments, as done in the first instance here,
causes the current state of spooling to be displayed.
START
The START command executes a SQL*Plus script file. This command functions the
same as the @ command. Following is its syntax:
filename The name of the file that you want to execute. The default
extension is .sql.
arg A command-line argument that you want to pass to the file.
STARTUP
The STARTUP command allows you to start an instance and open a database. You
must be connected as INTERNAL, SYSDBA, or SYSOPER to use this command.
Following is its syntax:
1052 Appendixes
STORE
The STORE command generates a text file with SET commands reflecting the current
SQL*Plus settings. Following is its syntax:
filename Specifies the name of the file to which you want to write the
SET commands
CREATE Creates a new file and returns an error if the file already exists
REPLACE Replaces an existing file and creates a new one if necessary
APPEND Appends commands onto the end of an existing file
The file c:\a\settings.sql now contains all the SET commands necessary to
reset the SQL*Plus environment to its current state. You can change those settings
and revert back later by using the @ command to execute the file.
TIMING
Allows you to start and stop a SQL*Plus timer. Following is its syntax:
Note Using the TIMING command with no parameters causes SQL*Plus to display the
number of active timers.
The format for the elapsed time is platform-specific. On Windows platforms, the
elapsed time is displayed in milliseconds. On most UNIX platforms, it’s displayed in
minutes and seconds.
TTITLE
The TTITLE command defines a header (top title) that appears at the top of each
page of a report. Following is its syntax:
1054 Appendixes
text Specifies text that you want to appear as part of the title.
user_var Specifies a user variable, the contents of which will
appear in the title. This may also be one of the following
predefined user variables: SQL.LNO for the current line
number, SQL.PNO for the current page number,
SQL.RELEASE for the current Oracle release number,
SQL.SQLCODE for the current error number, and
SQL.USER for the current username.
COL col_num Indents to the specified column.
SKIP lines Skips the specified number of lines.
LEFT Causes subsequent text to appear left-justified in the
current line.
CENTER Causes subsequent text to appear centered in the
current line. Note that the definition of center is
controlled by the SET LINESIZE command.
RIGHT Causes subsequent text to appear flush right. Note that
the SET LINESIZE command also defines the right edge
of the line.
BOLD Causes text to be printed three times in succession, on
three different lines.
FORMAT format Specifies a display format to use for subsequent text or
numeric values. See the section early in this chapter
titled “SQL*Plus Display Formats” for details on
specifying format strings.
OFF Turns the page header off.
ON Turns the page header on.
Animal Listing
Page 1
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1055
You can use the TTITLE command with no arguments to see the current title
setting, as shown in the following example:
SQL> TTITLE
ttitle ON and is the following 72 characters:
CENTER “Animal Listing” SKIP 1 FORMAT 999 CENTER “Page “ sql.pno
UNDEFINE
The UNDEFINE command undefines a SQL*Plus user variable. Following is its
syntax:
UNDEF[INE] variable
variable The name of the user variable that you want to undefine
In this example, the variable X was defined, displayed, and then undefined. When
another attempt was made to display the value of X, an error message was
returned.
VARIABLE
The VARIABLE command defines a SQL*Plus bind variable. Following is its syntax:
variable The name of the bind variable that you want to define.
data_type One of the following datatypes: NUMBER, CHAR, VARCHAR2,
NCHAR, NVARCHAR2, CLOB, NCLOB, and BLOB. You may specify a
length for the character string variables, but not for NUMBER
and not for the LOB types.
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1056
1056 Appendixes
WHENEVER OSERROR
The WHENEVER OSERROR command allows you to specify an action to take in the
event that an operating system error occurs. Following is its syntax:
WHENEVER OSERROR
{EXIT [SUCCESS|FAILURE|value|:bind_variable|]
[COMMIT|ROLLBACK]
|CONTINUE [COMMIT|ROLLBACK|NONE]}
The following example illustrates the use of the WHENEVER OSERROR command:
In this example, SQL*Plus will exit when an operating system error occurs, and an
exit status indicating a failure will be returned to the operating system.
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1057
WHENEVER SQLERROR
The WHENEVER SQLERROR command allows you to specify an action to take in the
event that a SQL error occurs. Following is its syntax:
WHENEVER SQLERROR
{EXIT [SUCCESS|FAILURE|value|:bind_variable|]
[COMMIT|ROLLBACK]
|CONTINUE [COMMIT|ROLLBACK|NONE]}
The following example illustrates the use of the WHENEVER SQLERROR command:
In this example, SQL*Plus will exit when a SQL error occurs. The exit status
returned to the operating system will indicate success, but the transaction will be
rolled back.
✦ ✦ ✦
4623-6 AppC.f.qc 1/28/00 12:37 PM Page 1058