Subject how to delayed update in trigger
Author svanderclock

we have 2 tables


in invoice we have a field Amount. we update this field by the help of a triger, everytime an items is add, delete or updated.

the problem is that, if i create an invoice with 10 items, i will 10 times update the field amount in the invoice ! this what i don't want, i want to update the invoice amount only at the end when all the items are inserted.

so is it possible to "delayed the update of the amount" to not update it for every insert ?

for exemple a trigger "before commit" will be a perfect solution for me (with the help of temp table)

or any other suggestion ?

thanks you by advance