Predefined exceptions, PL-SQL Programming

Assignment Help:

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


Related Discussions:- Predefined exceptions

Anatomy of a table, Anatomy of a Table: Figure shows the terminology u...

Anatomy of a Table: Figure shows the terminology used in SQL to refer to parts of the structure of a table. As you can see, SQL has no official terms for its counterpa

%notfound - implicit cursor attributes, %NOTFOUND The %NOTFOUND is the...

%NOTFOUND The %NOTFOUND is the logical opposite of the %FOUND. The %NOTFOUND yields TRUE when an INSERT, UPDATE, or DELETE statement affected no rows, or the SELECT INTO state

Creating Views, Create a view named CustomerAddresses that shows the shippi...

Create a view named CustomerAddresses that shows the shipping and billing addresses for each customer in the MyGuitarShop database. This view should return these columns from the

Opening a cursor, Opening a Cursor Opening the cursor executes the que...

Opening a Cursor Opening the cursor executes the query & identifies the result set that consists of all rows that meet the query search criteria. For the cursors declared usin

Long and long raw in pl/sql, LONG and LONG RAW You use the LONG datatyp...

LONG and LONG RAW You use the LONG datatype to store the variable-length character strings. The LONG datatype is such as the VARCHAR2 datatype, except that the maximum length o

Parameter and keyword description - records, Parameter and Keyword Descript...

Parameter and Keyword Description: record_type_name: This identifies the user-defined type specifier that is used in the subsequent declarations of the records. NOT N

Lob types in pl/sql, LOB Types The large object (LOB) datatypes like BF...

LOB Types The large object (LOB) datatypes like BFILE, BLOB, CLOB, and NCLOB store the blocks of unstructured data (like graphic images, text, video clips, and sound waveforms)

Example of wrap operator - sql, Example of WRAP Operator - SQL The eff...

Example of WRAP Operator - SQL The effect of Example can be obtained in SQL but note that one needs to write down not only the names of the columns being wrapped but also the

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

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

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd