Predefined exceptions, PL-SQL Programming

Predefined Exceptions

The internal exception is raised implicitly whenever your PL/SQL program exceeds a system-dependent limit or violates an Oracle rule. Each & every Oracle error has a number, but exceptions should be handled by the name. Therefore the, PL/SQL predefines some general Oracle errors as exceptions. For illustration, the PL/SQL raises the predefined exception NO_DATA_FOUND when a SELECT INTO statement returns no rows.

You can use the OTHERS handler, to handle the other Oracle errors. The SQLCODE & SQLERRM functions are primarily very helpful in the OTHERS handler since they return the message text & the Oracle error code. Otherwise, you can use the pragma EXCEPTION_INIT to relate an exception names with the Oracle error codes.

The PL/SQL declares predefined exceptions globally in the package STANDARD that defines the PL/SQL atmosphere. Therefore, you need not declare them yourself. You can write the handlers for predefined exceptions using the names shown in the list below. The corresponding Oracle error codes and SQLCODE return values are also shown.

2414_predefined exceptions.png

A short description of the predefined exceptions is as shown below:

2382_predefined exceptions2.png

718_predefined exceptions1.png

Posted Date: 10/5/2012 5:09:54 AM | Location : United States







Related Discussions:- Predefined exceptions, Assignment Help, Ask Question on Predefined exceptions, Get Answer, Expert's Help, Predefined exceptions Discussions

Write discussion on Predefined exceptions
Your posts are moderated
Related Questions
i NEED THE QURIES TO SOME OF THE PROBLEMS USING plsql

Product-specific Packages The Oracle and different Oracle tools are supplied with the product-specific packages which help you to build the PL/SQL-based applications. For illus

Declaring Objects: You can use the object types wherever built-in types like CHAR or NUMBER can be used. In the block below, you can declare object r of type Rational. Then, yo

Benefit of the dynamic SQL: This part shows you how to take full benefit of the dynamic SQL and how to keep away from some of the common pitfalls. Passing the Names of Sc

LEVEL You use the LEVEL with the SELECT CONNECT BY statement to categorize rows from a database table into a tree structure. The LEVEL returns the level number of a node in a

Accessing Attributes: You can refer to an attribute only by its name not by its position in the object type. To access or modify the value of an attribute, you can use the dot

Iterative Control: LOOP  Statements The LOOP statement executes a series of statements multiple times. There are 3 forms of LOOP statements: LOOP, WHILE-LOOP, & FOR-LOOP. LOOP

What is Cursors how to use it in Real time application ?

Using ROLLBACK The ROLLBACK statements end the present transaction and undo any change made during the transaction. The Rolling back is helpful for two reasons. Firstly, if yo

Use the PLS_INTEGER Datatype When you require to declare an integer variable, use the datatype PLS_INTEGER that is the most efficient numeric type. That is as the PLS_INTEGER