Oracle FAQ Your Portal to the Oracle Knowledge Grid

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

Re: help with exceptions please

From: <>
Date: Mon, 24 Sep 2007 13:14:19 -0700
Message-ID: <>

On Sep 23, 6:54 pm, DA Morgan <> wrote:
> wrote:
> > RAISE_APPLICATION_ERROR(error_number, error_message [, keep_errors])
> > since they have no name, there is no way one could catch them using:
> > WHEN error_name THEN
> > so there's nothing you can do about them.
> The intent of RAISE_APPLICATION_ERROR is not to trap them it is to
> RAISE them as in send them to the front-end application. This syntax
> is most commonly found in an exception block.

OK. So for exceptions such as
my_exception EXCEPTION;
the point can be to catch and handle, however the other types of errors with negative numbers including the ORA- and ones raised with RAISE_APPLICATION_ERRORS type errors, the point is to give them to the front end application (even though you can associate exceptions with negative numbers if you wish to). Let me know if i have it wrong.

> > (by the way, why would one want to keep_errors or not keep_errors
> > here?)

My question is, what's the point of keeping_errors vs. not keeping_errors when raising an application error? I understand you can have a stack of errors that are propogated, but why throw away the stack vs. not throw it away?

> > 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.
> Again I don't get the point of your question.

Not a question, more of an "Am I wrong?"

But now I do have a question. If the point of the negative number type errors is not to trap them, then what would be the point of associating them with an identifier/name using EXCEPTION_INIT?

also, as for the terminology are the ones with negative numbers called exceptions too? Or application errors? Just trying to understand here.

> > is this an accurate description?
> Reasonably so. You can find working demos of all of these at:
> For robust application error handling research these:
> dbms_utility.format_call_stack
> dbms_utility.format_error_backtrace
> dbms_utility.format_error_stack
> You will find demos of their useage at:


> --
> Daniel A. Morgan
> University of Washington
> (replace x with u to respond)
> Puget Sound Oracle Users

thanks. Received on Mon Sep 24 2007 - 15:14:19 CDT

Original text of this message