How exceptions propagate in pl/sql programming?, PL-SQL Programming

Assignment Help:

How Exceptions Propagate ?

Whenever an exception is raised, and if the PL/SQL cannot find a handler for it in the present subprogram or block, the exception propagates. That is, the exceptions reproduce it in the succeeding enclosing blocks until a handler is found or there are no more blocks to search. In the latter situation, the PL/SQL returns an unhandled exception error to the host atmosphere.

Though, exceptions cannot propagate across the remote procedure calls (RPCs). As a result, the PL/SQL block cannot catch an exception raised by a remote subprogram.

1751_exceptions propogate.png

 

581_exceptions propogate1.png

 

2358_exceptions propogate2.png

An exception can propagate additional than its scope, that is, additional than the block in which it was declared. Consider the illustration which is as shown below:

BEGIN

...

DECLARE ---------- sub-block begins

past_due EXCEPTION;

BEGIN

...

IF ... THEN

RAISE past_due;

END IF;

END; ------------- sub-block ends

EXCEPTION

...

WHEN OTHERS THEN

ROLLBACK;

END;

As the block in which the exception past_due was declared has no handler, the exception propagates to the enclosing block. But, according to the scope rules, the enclosing blocks cannot reference the exceptions declared in a sub-block. Therefore, only an OTHERS handler can catch the exception.


Related Discussions:- How exceptions propagate in pl/sql programming?

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)

Introduction to SQl and DQL, which operation is used if we are interested i...

which operation is used if we are interested in only certain columns of a table?

Write a stored procedure, a. Create a table odetails_new. It has all the a...

a. Create a table odetails_new. It has all the attributes of odetails and an additional column called cost, whose values are the product of the quantity and price of the part bein

Row counterparts of table operators - sql, Row Counterparts of Table Operat...

Row Counterparts of Table Operators SQL does not have counterparts tuple rename, tuple projection, tuple extension, tuple join and tuple compose. To obtain the same effects as

Restriction in sql, Restriction in SQL Syntax: SELECT DISTINCT...

Restriction in SQL Syntax: SELECT DISTINCT StudentId FROM IS_CALLED WHERE Name = 'Boris' The WHERE clause operates on the result of the FROM clause in analogo

Selecting objects in pl sql, Selecting Objects: Suppose that you have ...

Selecting Objects: Suppose that you have run the SQL*Plus script below that creates object type Person and object table persons, and that you have settled the table: CREATE

Grouping and ungrouping in sql, Grouping and Ungrouping in SQL Example...

Grouping and Ungrouping in SQL Example specifying EXAM_MARK in place of COURSE in the main FROM clause. Example: Obtaining C_ER2 from EXAM_MARK SELECT CourseId, CAST

Merge two data sources to sql azure database, Project Description: I hav...

Project Description: I have two types of data sources. One that is a list in SharePoint and another that is an access desktop database. The access desktop database is fairly com

Collection methods in pl sql, Collection Methods:   The collection me...

Collection Methods:   The collection method is a built-in function or procedure which operates on the collections and is called using the dot notation. The methods like the C

Defining autonomous transactions, Defining Autonomous Transactions To ...

Defining Autonomous Transactions To define an autonomous transaction, you use the pragma (compiler directive) AUTONOMOUS_TRANSACTION. The pragma instructs the PL/SQL compiler

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