Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to write this trigger ??
Table is Mutating ... error occurs because you are trying to update the same table on which you are attempting to write a trigger. Oracle identifies that as a possible condition for a infinite loop and hence does not allow it.
In the present case, why dont you get the count first and then simply insert all fields in one statement?
-- sparmanand.removeit_at_msn.com remove the words removeit from the e-m address rkrishag_at_ikon.com wrote in article <879892888.28746_at_dejanews.com>...Received on Tue Nov 18 1997 - 00:00:00 CST
> Hi all,
>
> How do I write a trigger on Insert in a table, which will find the no. of
> records updated in a different table and update one of the fields in the
> original inserted record. The record structure of the original insert is
> "batch_id, exp_recs and upd_recs". The first 2 fields will be populated
> on insert. While the third field value is to be populated by the count(*)
> of another table which has a field batch_id. I am getting "Table is
> mutating, trigger/function may not see it" error.
>
> Can anyone give me a solution for the same.
> Regards
> Rajesh
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
>