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: Hans Börjesson <hansb_at_NOSPAMvendimo.com>
Date: Mon, 10 Mar 2003 07:19:56 +0100
Message-ID: <b4hah9$1hk$1@yggdrasil.utfors.se>


Hi!

> Have the trigger call a stored procedure that is an autonomous
transaction, or,
> add an after-insert trigger to do the other inserts. One or both might
work.

I will check this out to see if it works. An after-insert itself does not seems to work. I have to save the rowid for each row etc as the article http://osi.oracle.com/~tkyte/Mutate/index.html describes. I was just curious if this could be solved easier (maybe new functionality in Oracle 9i).

>
> 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 Received on Mon Mar 10 2003 - 00:19:56 CST

Original text of this message

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