Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Mutating Triggers
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
The Magnet  
View profile  
 More options Sep 20 2010, 9:14 pm
Newsgroups: comp.databases.oracle.tools
From: The Magnet <a...@unsu.com>
Date: Mon, 20 Sep 2010 18:14:18 -0700 (PDT)
Local: Mon, Sep 20 2010 9:14 pm
Subject: Mutating Triggers
I've read a bunch of this but not 100% how to implement it.  We are on
10gR2.

We've an customer order table.  When a given product is ordered we
need to set all other products in that customer account to a given
status.  We also need to save the existing order status in a different
column so we have it when we are ready to revert the orders back.

We have 2 procedures:  SUSPEND_ORDER & RESTORE_ORDER.  Procedures that
select the data and store it in another column of the same table, or
restore the original column with the saved value.  This will throw an
error as we are running into that mutating table error.

Basic logic is:  They order product X, for all other orders in their
account, save their status in column A and set those orders to a
Cancelled status.

When product X completes, take all the saved data from column A and
restore the status of those original orders.

So, with all this logic, how to avoid the mutating table error?  This
is a lot of code so I do not want to put it all into a trigger.  I'd
rather call the procedure as who knows, in the future we may use that
code elsewhere.

Does any of this make sense?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Carlos  
View profile  
 More options Sep 21 2010, 9:38 am
Newsgroups: comp.databases.oracle.tools
From: Carlos <miotromailcar...@netscape.net>
Date: Tue, 21 Sep 2010 06:38:22 -0700 (PDT)
Local: Tues, Sep 21 2010 9:38 am
Subject: Re: Mutating Triggers
On Sep 21, 3:14 am, The Magnet <a...@unsu.com> wrote:

There is no such thing 'mutating triggers' but 'mutating tables', and
they are related to ORA-04091.

:"We've an customer order table.  When a given product is ordered we
need to set all other products in that customer account to a given
status."

Why?

:"We also need to save the existing order status in a different column
so we have it when we are ready to revert the orders back."

It smells like a very bad design...

:"So, with all this logic, how to avoid the mutating table error?"
Rethink the whole process.

:"Does any of this make sense?"
I don't think so.

Cheers.

Carlos.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim X  
View profile  
 More options Sep 27 2010, 5:42 am
Newsgroups: comp.databases.oracle.tools
From: Tim X <t...@nospam.dev.null>
Date: Mon, 27 Sep 2010 19:42:08 +1000
Local: Mon, Sep 27 2010 5:42 am
Subject: Re: Mutating Triggers

No, not really. Either I don't understand your descripiton of your data
model and how it works or it is a very bad model. More info requried -
ideally with a sample table and perhaps some sample transactions. From
your description, it really sounds like your doing something very odd.

Tim

--
tcross (at) rapttech dot com dot au


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »