Subject Re: [firebird-support] Help with a trigger/procedure
Author Dimitry Sibiryakov
On 27 Jul 2006 at 17:22, Fabio Gomes wrote:

>I ll try to explain what i need.. i have 2 tables, one that have the
>general stock history, and other with the current stock of each item
>(i used the serial number as primary key).

What you are talking about is usually called "stored aggregates"
and is not recommended to be used without absolute necessity.
Keeping current quantity by triggers may be troublesome in
multiuser environment. More often the quantity is kept for some date
in the past and current quantity is computed as that quantity + sum
of operations since then.

SY, Dimitry Sibiryakov.