Re: Change default error message on check constraint

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 29 Feb 2008 00:07:19 -0800
Message-ID: <1204272436.515008@bubbleator.drizzle.com>


dean wrote:
> Hi,
>
> [10g/Win]
>
> Is there a way to change the error message given to a user when a
> check constraint is violated?
>
> For example, instead of:
>
> "ORA-02290: Check constraint (GC_JAN08.TR_ORIG_T_BEFORE_DEPT_T)
> violated"
>
> I would prefer to see:
>
> "Error: Origination time must be before departure time."
>
> I realize this can always be done in the app code.
>
> Thanks!

Remap it using PRAGMA EXCEPTION_INIT

Go to Morgan's Library at www.psoug.org and look up this pragma for a demo.

-- 
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Fri Feb 29 2008 - 02:07:19 CST

Original text of this message