InterviewSolution
| 1. |
Predefined Exceptions in PL/SQL |
|
Answer» If a PL/SQL program violate the rule of Oracle, then an exception is raised. The exceptions are handled by name, for example, DUP_VAL_ON_INDEX exceptions is raised when an attempt is MADE to store duplicate VALUES in a database column CONSTRAINED by a unique index. Let us learn about the predefined exceptions in PL/SQL:
This exception is raised when an attempt is made to the attributes of an uninitialized object.
This exception is raised when none of the choices in the WHEN clause of a CASE statement is selected and there is no ELSE clause.
This exception is raised when an attempt is made to apply collection methods other than EXISTS to an uninitialized nested table or varray.
This exception is raised when duplicate values are ATTEMPTED to be stored in a column with unique index.
This exception is raised when attempts are made to make a cursor operation that is not allowed, such as closing an unopened cursor.
This exception is raised when the CONVERSION of a character string into a number fails because the string does not represent a valid number.
This exception is raised when a program attempts to log on to the database with an invalid username or password.
This exception is raised when a SELECT INTO statement returns no rows.
This exception is raised when a database call is issued without being connected to the database.
This exception is raised when there is an internal problem.
This exception is raised when a cursor fetches value in a variable having incompatible data type.
This exception is raised when a member method is invoked, but the instance of the object type was not initialized.
This exception is raised when PL/SQL ran out of memory.
This exception is raised when SELECT INTO statement returns more than one row.
This exception is raised when arithmetic, conversion, or truncation error occurs.
This exception is raised when an attempt is made to divide a number by zero. |
|