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](https://www.expertsmind.com/CMSImages/1751_exceptions propogate.png)
![581_exceptions propogate1.png](https://www.expertsmind.com/CMSImages/581_exceptions propogate1.png)
![2358_exceptions propogate2.png](https://www.expertsmind.com/CMSImages/2358_exceptions%20propogate2.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.