Hi ,
CREATE OR REPLACE PACKAGE p_exception
error_no1 NUMBER := -20001;
error_no2 NUMBER := -20002;
error_no3 NUMBER := -20003;
error_no1 NUMBER := -20004;
error_msg1 varchar2(100) := 'Message 1';
error_msg2 varchar2(100) := 'Message 2';
error_msg3 varchar2(100) := 'Message 3';
error_msg4 varchar2(100) := 'Message 4';
END;
/
CREATE OR REPLACE PACKAGE BODY p_exception
PROCEDURE raise_exception(p_error_in NUMBER, p_message VARCHAR2 DEFAULT NULL) AS
BEGIN
RAISE_APPLICATION_ERROR(p_error_in, p_message);
END;
END;
I have create the above package for ensuring uniqueness while raising RAISE_APPLICATION_ERROR. raise_exception procedure would be called from different package.
Do we have any alternative way other than creating package to ensure uniqueness while raising RAISE_APPLICATION_ERROR.
I don't want to use the same Error number for throwing a another exception.
For Example if -200001 is already used then I don't want to use the same number for throwing another exception.
Could anyone suggest.