Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Can someone explain user-defined exceptions??
The easisest way I can think of it is if a piece of data violates a business
rule but not a programming rule.
For example, if a purchase order can't exceed 500$ but one comes through for 600, or if filling an order would result in negative inventory. A user defined exception can be invoked to say 'No More Items On Hand' or something, instead of 'Invalid Quantity.'.
In article <6v39o0$50c$1_at_nnrp1.dejanews.com>,
singeri_at_my-dejanews.com wrote:
> Hi all,
>
> I am very confused over USER-DEFINED exceptions in PL/SQL where you define an
> exception that is a NON-ORACLE error, and associate it with a number that is
> in the range that oracle says is user-definable. My question is what is the
> purpose of the user-defined number that is a associated with the user-defined
> exception after they are tied together via a PRAGMA EXCEPTION_INIT
> statement???
>
> I cannot see the value of using the number since you raise and handle the
> exception via the exception name??
>
> Any insight will be VERY useful.
> TIA, Irv
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Oct 02 1998 - 15:53:48 CDT