Hi All.
XE 11.2
As a follow on from yesterdays question. I'm trying to create a trigger on a table that sums values in the table including existing ones and new one, then populates a summary table with this value.
For example, in the main table I have a number of records with a matching code and a value i.e.
( ID,CODE,VALUE)
(1,'AAA',1234.56)
(2,'AAA',2213.45).
When I insert a new record that matches the CODE (AAA), the trigger sums the existing values, as well as the newly inserted value, and then updates/inserts into an aggregation table with the code and sum of the 3 values.
My Question is whether this is possible? i.e. can I do a query on the table as part of an after insert/update, and will it sum correctly, or will it give me a mutating table error? If the latter, (and Im just going to try this), can anyone suggest alternatives.. (I can't create views or materialized views, because another table will also be inserting into the aggregate table...)
Kind Regards
Richard