| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: The fable of DEMETRIUS, CONSTRAINTICUS, and AUTOMATICUS
Tony Andrews wrote:
>
> Do you mean really storing the entire rule as data, or do you mean
> parameterized rules? In other words, for a rule like "daily hours may
> not exceed 24" (and please, ignoring any feelings about that specific
> rule!) do we have:
>
> 1) User inserts a row into the "rule" table:
>
> insert into rules( rule_id, rule ) values (42, 'daily_hours <= 24');
>
> OR
>
> 2) User updates a "rule parameter" value:
>
> update rule_parameters
> set value = 24
> where name = 'max_daily_hours';
>
> In the first case, you have the ultimate user control - a rules engine?
> In which case, maybe it generates DDL?
>
> In the second (more common) case, the actual rule is hard-wired into
> the system somewhere - and may as well be DDL as anything else, no?
As Marshall points out in his reply, the conversation is definitely heading towards rules engines, which give as you say ultimate user control. The danger to them is that you just create another way to have confusing code.
But to answer your question, your approach #1 above is actually 'code in disguise", you don't want that. You want approach #2 above, which is actually Tool #3 in my current road map:
Customer_Type Item Discount ============= ======= ============= RETAIL null/blank 0 DEALER null/blank 10 DEALER GONKULATOR 15
In conclusion, I have worked on huge systems with hundreds of tables and have seen the above ideas implemented (though never all 4 at once) in combinations that always seemed to work without the constraint being part of the DDL.
-- Kenneth Downs Use first initial plus last name at last name plus literal "fam.net" to email meReceived on Thu Oct 21 2004 - 16:12:21 CDT
![]() |
![]() |