Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> help with exceptions please

help with exceptions please

From: <jgarfield_at_earthlink.net>
Date: Sun, 23 Sep 2007 14:24:37 -0700
Message-ID: <1190582677.651764.323680@d55g2000hsg.googlegroups.com>

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.

  1. "oracle errors" ("application errors?") e.g. ORA-99999. All already have NUMBERS and MESSAGES. Some have NAMES (identifiers) such as ACCESS_INTO_NULL. The ones with names are the ones in the standard package.

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US