A User-defined exception has to be defined by the programmer.
User-defined exceptions are declared in the declaration section with their type as exception.
They must be raised explicitly using RAISE statement, unlike pre-defined exceptions that are raised implicitly.
RAISE statement can also be used to raise internal exceptions.
Exception:
DECLARE
userdefined EXCEPTION;
BEGIN
<Condition on which exception is to be raised>
RAISE userdefined;
EXCEPTION
WHEN userdefined THEN
<task to perform when exception is raised>
END;
User-defined exceptions are declared in the declaration section with their type as exception.
They must be raised explicitly using RAISE statement, unlike pre-defined exceptions that are raised implicitly.
RAISE statement can also be used to raise internal exceptions.
Exception:
DECLARE
userdefined EXCEPTION;
BEGIN
<Condition on which exception is to be raised>
RAISE userdefined;
EXCEPTION
WHEN userdefined THEN
<task to perform when exception is raised>
END;
No comments:
Post a Comment