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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Mutating table inside trigger

Re: Mutating table inside trigger

From: Ed Prochak <edprochak_at_adelphia.net>
Date: Mon, 10 Mar 2003 16:45:41 GMT
Message-ID: <3E6CC4E7.3030701@adelphia.net>


Hans Börjesson wrote:
> Hi!
>

[]
>

>>But a bigger issue here is what appears to be a design error. Why should
>>inserting one record in a table cause other records to be inserted into
>> the same
>>table? Consider this in terms of normalization and business logic. For
>> example
>>why is it that the procedure inserting the original record isn't just
>> adding the
>>additional records too?
>>

>
> Well this is functionality for an specific customer and what they want is
> that when you add an activity "Sent product information" you should add
> three other activities "call up after 1 day", "call up after 7 days" and
> "call up after 60 day". The system will then nofity the user what they
> should do (in this case call up the customer and try to sell something).
> Since the data in all four activites are more or less the same except for
> the activity type and the activity date it would be frustrating if they
> needed to add all four activies by hand. The system can however create a lot
> of other activites that should not create any other activites (actually it
> is only in this case it should create other activities).
>
> Thanks for your help
> Regards
> /Hans Börjesson

But the question arises: Why do you want to hardcode business logic into the database? This should, as Daniel pointed out, be done at the application level, or maybe the middle level in a 3-tier architecture. You are making this harder by trying to do it in the database.

If your application is designed well, you should be able to do this in the application. I've worked on susch systems (precisely of the type you describe: customer ordering with bundled products). There are much better, more flexible ways to do this.

Drop me an email to discuss off-line.

-- 
Ed Prochak
running: http://www.faqs.org/faqs/running-faq/
family:  http://web.magicinterface.com/~collins
--
"Two roads diverged in a wood and I
I took the one less travelled by
and that has made all the difference."
robert frost
Received on Mon Mar 10 2003 - 10:45:41 CST

Original text of this message

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