What does the RAISE_APPLICATION_ERROR mean ? When this error is raised whether the database errors are occurred ? Please can any one explain clearly what this error means ?
Also What does the seq_collision exception means and when it will be raised under what conditions ? What is the general correction to be done when this type of error occurs ?
RAISE_APPLICATION_ERROR is used to create a user defined error messages.
The user defined messages are associated with the user defined number (SQLCODE) using RAISE_APPLICATION_ERROR.
Eg:
DECLARE
a NUMBER := 0;
b NUMBER := 10;
BEGIN
IF(a = 0) THEN
RAISE_APPLICATION_ERROR(-20000,' Cannot Divide by Zero');
ELSE
b: = b/a;
END IF;
END;
The number passed in the RAISE_APPLICATION_ERROR should be negative and between -20000 and -20999