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
Initializing and Referencing Collections Until you initialize a collection, a nested table or varray is automatically null (i.e. the collection itself is null, not its elements)

Using a join on 3 tables, select 5 columns and 10 rows from the 3 tables without the use of a Cartesian product Query: SELECT E.LAST_NAME, E.FIRST_NAME, S.BUILDING, S.BRAN

Updating Variables For assignment, SQL uses the key word SET, as in SET X = X + 1 (read as "set X equal to X+1") rather than X: = X + 1 as found in many computer languages.

Advantages of Packages The benefits of the Packages are as shown below: Modularity The Packages encapsulate logically associated items, types, and subprograms in the

Tautology - Equivalences Rules: If there Tautologies are not all the time as much easy to note as the one above so than we can use these truth tables to be definite that a sta

User-Defined Exceptions The PL/SQL defines the exceptions of your own. Dissimilar to the predefined exceptions, the user-defined exceptions should be declared and should be rai

Updating by insertion Syntax : INSERT INTO ENROLMENT VALUES (SID ('S4'), 'Devinder', CID ('C1'));

Error Handling The PL/SQL makes it easy to detect and process the predefined and user-defined error conditions known as exceptions. Whenever an error occurs, an exception is ra

At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean’s wants to create a trigger that automatically updates the stock level of all pr

Declaring and Initializing Objects: An object type is once defined and installed in the schema; you can use it to declare the objects in any PL/SQL, subprogram, block or packa