Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Mutating table inside trigger
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
![]() |
![]() |