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

Home -> Community -> Usenet -> c.d.o.server -> Re: Help with Mutating Table - Are there other solutions?

Re: Help with Mutating Table - Are there other solutions?

From: Joachim Zobel <jzobel_at_my-dejanews.com>
Date: Sat, 13 Dec 2003 22:53:36 +0100
Message-ID: <pan.2003.12.13.21.53.35.426431@my-dejanews.com>


On Sat, 13 Dec 2003 11:39:23 -0500, contrapositive wrote:

> Two tables, ORDERS and DETAIL_LINES:
>
> ORDERS.order_id
> ORDERS.cust_id
> ORDERS.order_status, etc...
>
> DETAIL_LINES.order_id
> DETAIL_LINES.line_id
> DETAIL_LINES.line_status, etc...
>
> An order has one or more detail lines.
>
> We want an update trigger (for each row) on DETAIL_LINES that says if this
> line_status is being changed to HOLD, then all the other lines for this
> order should change to HOLD. Obviously, that means we're attempting to
> update the table that's being triggered, and the "mutating table" error is
> raised.

Seems you are using triggers to fix design redundancy. Why is HOLD reflected in the line_status, if it can only be set for the whole order?

You can use the trigger approach to fix this, but in the long run it will come back again to cause trouble.

Sincerely,
Joachim

-- 
Warnung: \" kann Augenkrebs verursachen. 
Received on Sat Dec 13 2003 - 15:53:36 CST

Original text of this message

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