Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Check constraint violated
Me wrote:
> On Sat, 14 Jun 2003 11:33:48 +0000, andrewst wrote:
>
>
>>Originally posted by Me >> >>>On Fri, 13 Jun 2003 21:33:43 +0530, Me wrote: >>> >>>>2) How can I put a check constraint that allows entering data >>> >>> into apointee only >>> >>>>if the nominee's age is lesser than 18? >>> >>>Could someone help me with this constraint. >> >>ALTER TABLE apointee >>ADD CONSTRAINT chk_nominee_age CHECK (age < 18);
Well, your requirement doen't sound like a check constraint, but a higher level business rule. You need to enforce it in the application layer. Constraints cannot solve ALL these problems, and you don't want to be changing the DB each time a rule like this changes.
-- Ed Prochak running http://www.faqs.org/faqs/running-faq/ netiquette http://www.psg.com/emily.html -- "Two roads diverged in a wood and I I took the one less travelled by and that has made all the difference." robert frostReceived on Sat Jun 14 2003 - 11:08:46 CDT
![]() |
![]() |