Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> help with exceptions please
I'm trying to understand oracle exceptions. There appear to be many different ways that exceptions are defined. Following is how I understand it. Please let me know if I'm wrong or if my terminology is off.
You can't catch an error without a name, must use EXCEPTION_INIT to give the number a name.
2) user defined exceptions - NO NUMBERS or MESSAGES associated with them, but they do have NAMES e.g.
e_invalid_id EXCEPTION;
3) user defined "application errors," have NUMBER and MESSAGE but NO NAME. e.g.
RAISE_APPLICATION_ERROR(error_number, error_message [, keep_errors])
since they have no name, there is no way one could catch them using:
EXEPTION
WHEN error_name THEN
so there's nothing you can do about them.
(by the way, why would one want to keep_errors or not keep_errors here?)
Also, you can associate an oracle error but not a custom application error (#3 above) with an exception name using this pragma:
EXCEPTION_INIT(e_child_exists, -1234);
These now have a NAME and a NUMBER, and the MESSAGE already assigned to that number.
is this an accurate description? Received on Sun Sep 23 2007 - 16:24:37 CDT
![]() |
![]() |