Home » RDBMS Server » Server Administration » Constraint Error Message?
Constraint Error Message? [message #49980] Thu, 21 February 2002 08:51 Go to next message
Fishstick Kitty
Messages: 1
Registered: February 2002
Junior Member
Is there a way to associate an error message with a constraint? For example, I have the following constraint on a table called remove_me:

ALTER TABLE REMOVE_ME ADD CHECK (MAX >= MIN);

When this constraint is created, it's given a system generated name (like SYS_C006163) so when this constraint is violated, the error message is:

ORA-02290: check constraint (SYS_C006163) violated

Which tells me nothing without diving into the DB to find out which constraint that is.

I know I can name the constraint something like MIN_MAX_CONSTRAINT, but I was wondering if there was a way to associate messages with constraints.

Thanks,Ed
Re: Constraint Error Message? [message #49983 is a reply to message #49980] Thu, 21 February 2002 12:37 Go to previous message
saleem
Messages: 65
Registered: January 2002
Member
alter table remove_me add constraint [[constraint_name]] check (max >= min);

that should give your constraint the name that makes it a bit more readable. the syntax might not be 100%, but it's close.
Previous Topic: Re: Synonym
Next Topic: Re: how to create a new database ( i am a new user)
Goto Forum:
  


Current Time: Tue Dec 24 11:59:44 CST 2024