SQL*Plus User's Guide and Reference
Release 8.1.5

A66736-01

Library

Product

Contents

Index

Prev Up Next

Command Reference, 51 of 52


WHENEVER OSERROR

Purpose

Exits SQL*Plus if an operating system error occurs (such as a file I/O error).

Syntax

WHENEVER OSERROR 
   {EXIT [SUCCESS|FAILURE|n|variable|:BindVariable][COMMIT|ROLLBACK]
   |CONTINUE [COMMIT|ROLLBACK|NONE]}

Terms and Clauses

Refer to the following list for a description of each term or clause:

EXIT [SUCCESS|FAILURE|n|variable|:BindVariable]

      Directs SQL*Plus to exit as soon as an operating system error is detected. You can also specify that SQL*Plus return a success or failure code, the operating system failure code, or a number or variable of your choice. See EXIT in this chapter for details.

CONTINUE

      Turns off the EXIT option.

COMMIT

      Directs SQL*Plus to execute a COMMIT before exiting or continuing and save pending changes to the database.

ROLLBACK

      Directs SQL*Plus to execute a ROLLBACK before exiting or continuing and abandon pending changes to the database.

NONE

      Directs SQL*Plus to take no action before continuing.

Usage Notes

If you do not enter the WHENEVER OSERROR command, the default behavior of SQL*Plus is to continue and take no action when an operating system error occurs.

If you do not enter the WHENEVER SQLERROR command, the default behavior of SQL*Plus is to continue and take no action when a SQL error occurs.

Examples

The commands in the following command file cause SQL*Plus to exit and COMMIT any pending changes if a failure occurs when writing to the output file:

SQL> WHENEVER OSERROR EXIT
SQL> START no_such_file
OS Message: No such file or directory
Disconnected from Oracle8......

Prev Up Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index