2017  Kodetalk | Feedback | Privacy Policy | Terms | About
userimage

What is Pragma EXECPTION_INIT

What is Pragma EXECPTION_INIT ? Explain the usage ?
userimage

Pragma exception_init Allow you to handle the Oracle predefined message by your own message. Means you can instruct compiler to associate the specific message to oracle predefined message at compile time. This way you improve the Readability of your program, and handle it according to your own way.

 

Syn: PRAGMA EXCEPTION_INIT(exception_name, -error_number);

Example:

DECLARE

                user_define_exception_name EXCEPTION;

                PRAGMA EXCEPTION_INIT(user_define_exception_name,-error_number);

BEGIN

                statement(s);

                IF condition THEN

                                RAISE user_define_exception_name;

                ENDIF;

EXCEPTION

                WHEN user_define_exception_name THEN

                                User defined statement (action) will be taken;

END;

 

Answer is