background image
<< Handling Errors and Exceptions | Custom Exceptions >>
<< Handling Errors and Exceptions | Custom Exceptions >>

Existing PL/SQL and SQL Exceptions

Handling Errors and Exceptions
4-42 Oracle Database 2 Day Developer's Guide
Existing PL/SQL and SQL Exceptions
Oracle Database will automatically raise an exception if a PL/SQL program violates a
known database rule, such as the predefined exception
NO_DATA_FOUND
if a
SELECT
INTO
statement returns no rows. The following table shows some of the common
exceptions.
See Also:
Oracle Database Concepts for information about exceptions
Oracle Database PL/SQL Language Reference for information about
handling PL/SQL errors
Oracle Database Error Messages for a list of standard Oracle
messages
Oracle Database PL/SQL Language Reference for guidelines on
handling errors and exceptions
Oracle Database PL/SQL Language Reference for advantages of
PL/SQL exceptions
Exception
Description
ACCESS_INTO_NULL
A program attempts to assign values to the attributes of an
uninitialized object
CASE_NOT_FOUND
None of the choices in the
WHEN
clauses of a
CASE
statement is selected,
and there is no
ELSE
clause.
COLLECTION_IS_
NULL
A program attempts to apply collection methods other than
EXISTS
to
an uninitialized nested table or varray, or the program attempts to
assign values to the elements of an uninitialized nested table or varray.
CURSOR_ALREADY_
OPEN
A program attempts to open a cursor that is already open. A cursor
must be closed before it can be reopened. A cursor
FOR
loop
automatically opens the cursor to which it refers, so your program
cannot open that cursor inside the loop.
DUP_VAL_ON_INDEX
A program attempts to store duplicate values in a column that is
constrained by a unique index.
INVALID_CURSOR
A program attempts a cursor operation that is not allowed, such as
closing an unopened cursor.
INVALID_NUMBER
In a SQL statement, the conversion of a character string into a number
fails because the string does not represent a valid number. (In
procedural statements,
VALUE_ERROR
is raised.) This exception is also
raised when the
LIMIT
clause expression in a bulk
FETCH
statement
does not evaluate to a positive number.
LOGIN_DENIED
A program attempts to logon to Oracle database with a user name or
password that is not valid.
NO_DATA_FOUND
A
SELECT
INTO
statement returns no rows, or your program references
a deleted element in a nested table or an uninitialized element in an
index-by table.
Because this exception is used internally by some SQL functions to
signal completion, do not rely on this exception being propagated if
you raise it within a function that is called as part of a query.
NOT_LOGGED_ON
A program issues a database call without being connected to Oracle
database.