Oracle PLSQL Tutorial 35- PRAGMA EXCEPTION_INIT with Example in PLSQL

preview_player
Показать описание
In this Video, I have explained PRAGMA EXCEPTION_INIT user defined exception in oracle plsql with example.

What is PRAGMA EXCEPTION_INIT
Unnamed System Exceptions: Those System Exceptions for which Oracle does not provide a name is known as Unnamed System Exception.

There are two ways to handle them :
By using WHEN OTHERS Exception Handler
By associating the Exception Code to a name using it as named exception.

We can assign a name to unnamed system exceptions using PRAGMA called EXCEPTION_INIT.
To handle error conditions (typically ORA- messages) that have no predefined name, you must use the OTHERS handler or the pragma EXCEPTION_INIT.
You can use EXCEPTION_INIT in the declarative part of any PL/SQL block, subprogram, or package.
The pragma must appear in the same declarative part as its associated exception, somewhere after the exception declaration.

Syntax of PRAGMA EXCEPTION_INIT

PRAGMA EXCEPTION_INIT(exception_name, -error_number);

Exception_name: A user-defined exception declared within the current scope.
error_number: Any valid Oracle error number. These are the same error numbers (always negative) returned by the function SQLCODE.

Some other Video related to PL SQL tutorial.
Oracle PLSQL Tutorial 34- RAISE_APPLICATION_ERROR with Example in PLSQL

Oracle PLSQL Tutorial 33- User Defined Exception with Example in PLSQL

Oracle PL/SQL Tutorial 32- Exception Handling with Example in PLSQL

Oracle PL/SQL Tutorial 31- Parameter Modes in Procedure(IN,OUT,INOUT) with Example

Oracle PL/SQL Tutorial 30- Stored Procedure in PLSQL with Example

Oracle PL/SQL Tutorial 29- Function INOUT Parameter in PLSQL with Example

--------------------------------------------------------------------------------------------------------

Our Social Link:-
Link (Blogger) :
Link (Facebook Group )
Link (Facebook Page)
Рекомендации по теме
Комментарии
Автор

Thank you Sir, for this awesome tutorial, eagerly waiting for your next video.
Please try to upload at least two videos per week, it's a humble request.

sandhyaltudu
visit shbcf.ru