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

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.

Posted Date: 10/5/2012 5:20:43 AM | Location : United States







Related Discussions:- How exceptions propagate in pl/sql programming?, Assignment Help, Ask Question on How exceptions propagate in pl/sql programming?, Get Answer, Expert's Help, How exceptions propagate in pl/sql programming? Discussions

Write discussion on How exceptions propagate in pl/sql programming?
Your posts are moderated
Related Questions
Datatype Conversion At times it is necessary to convert a value from one datatype to another. For e.g. if you want to inspect a rowid, you should convert it to a character stri

Interesting properties of CROSS JOIN - SQL Compare these with the "interesting properties of JOIN", CROSS JOIN is associative but not commutative. Unlike JOIN and NATURAL JOI

Using DELETE This process has three forms. The DELETE removes all elements from the collection. DELETE(n) removes the nth element from the nested table. When n is null, then D

Bulk Fetching The illustration below shows that you can bulk-fetch from a cursor into one or more collections: DECLARE TYPE NameTab IS TABLE OF emp.ename%TYPE; TYPE S

Use Native Dynamic SQL A few programs (a normal-purpose report writer for illustration) should build and process a variety of SQL statements at run time. Therefore, their full

Stored Subprograms Normally, tools (like Oracle Forms) which incorporate the PL/SQL engine can store subprograms locally for later, strictly local execution. Though, to become

query to Find the account numbers of all customers whose balance is more than 10,000 $

If two relations R and S are joined, then the non matching tuples of both R and S are ignored in __________________.

SQL Functions The PL/SQL uses all the SQL functions involving the following aggregate functions that summarize the whole columns of the Oracle data: GROUPING, AVG, COUNT, STDDE

We are seeking a freelance consultant that is familiar with Appgen applications. We require exporting all our data into a format appropriate for importing into SAP Business One. Pl