Subject | Re: [firebird-support] Foreign Key on update and after update trigger |
---|---|
Author | Dimitry Sibiryakov |
Post date | 2016-02-09T12:26:27Z |
09.02.2016 13:16, Svein Erling Tysvær setysvar@... [firebird-support] wrote:
WBR, SD.
> Then you should have a separate process that at set times (e.g. once every hour, day orI would add here "having count(*) > 1" to avoid unnecessary work.
> week), does something like:
>
> for select DistinctField, sum(MySummationField) from twarehouse_sum group by 1
> into :DistinctField, :MySum do
> begin--
> delete from twarehouse_sum where DistinctField = :DistinctField;
> insert into twarehouse_sum(DistinctField, SummationField)
> values(:DistinctField, :MySum);
> end
WBR, SD.