In Oracle, hundreds of standard system exceptions, such as ZERO_DIVIDE, are referenced by name.
These are known as predefined server errors. You learned about them in the previous lesson.
Internally, Oracle handles these messages by their error codes.
Exception Flag
Messages that are not named raise an exception flag, and the control transfers to the EXCEPTION block. These are referred to as non-predefined server errors. All such messages are caught by the OTHERS exception handler. You can provide names to such messages using the PRAGMA EXCEPTION_INIT command.
PRAGMA stands for pseudo instructions. It is the keyword that signifies that the statement is a compiler directive, which is not processed when the PL/SQL block is executed. Rather, it directs the PL/SQL compiler to interpret all occurrences of the exception name within the block as the associated Oracle server error number.
The following MouseOver best explains how to code these kinds of exceptions.
Click the Exercise link below to rearrange the code for a PL/SQL block that handles exceptions. Implicit User Defined Exceptions - Exercise
In the next lesson, you will learn how to raise explicit exceptions.