Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Conditional Constraint?

Re: Conditional Constraint?

From: J Alex <jalexanderssd_at_yahoo.com>
Date: Sun, 22 Dec 2002 14:09:10 GMT
Message-ID: <aIjN9.107454$Db4.2983776@twister.tampabay.rr.com>

"Howard J. Rogers" <howardjr2000_at_yahoo.com.au> wrote
> As soon as you start doing conditional constraints, you're talking
business
> logic. At which point, your attention invariably should turn the way of a
> before insert and/or before update trigger.
>
> The simple one, that all demerit points should be between 1 and 6 is a
check
> constraint:
>
> create table blah (
> col1 number);
> alter table blah add (constraint blah_col1_ck check (col1 between 1 and
6));
>
> But as soon as you start wanting to say "if this then that', it's trigger
> time.

Check constraints can include AND and OR logic, so a trigger isn't required here. Received on Sun Dec 22 2002 - 08:09:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US