Flag This Hub

Oracle Exceptions - User Defined and Oracle Defined

By


Oracle Exceptions -Oracle Defined and User defined

http://forums.oraclepassport.com

1. What are exceptions in Oracle?

Exceptions are the ways in which Oracle could handle runtime errors in a PL/SQL block. Exceptions are always useful to debug the code as well as ensure a smooth end for a Program without interupting the calling Program/Block.

2. What are the different types of Oracle Exceptions?

The main classification is Oracle Defined and User defined Exceptions

Oracle defined:

There are many built in exceptions which we can use. Most commonly used ones are:

a. NO_DATA_FOUND
b. TOO_MANY_ROWS_FOUND
c. VALUE_ERROR
d. ZERO_DIVIDE
e. INVALID_NUMBER
f. DUP_VALUE_ON_INDEX
g. CURSOR_ALREADY_OPEN
h. INVALID_CURSOR

User Defined:

User defined exceptions are defined in many ways.

a. New user defined Exceptions can be created using existing Oracle defined Exceptions

b. Entirely new Exceptions can be according to a user’s need. Eg: Raise an exception if employee salary entered is less than 0.

There are mainly 3 ways to use User Defined Exceptions

READ MORE at : http://www.oraclepassport.com/Oracle%20Exceptions.html

OraclePassport

Best Oracle 9i Tutorial
Best Oracle 9i Tutorial
Like this Hub?
Please wait working