Subject RE: [ib-support] Summary tables and triggers
Author Alan McDonald
it's not the way triggers work which would discourage the use of this
method, it's just overhead which is unnecessary (most of the time)
e.g.
select masterfield1, masterfield2,
(select sum(detailfield1) from detailtable where
detailtable.fk=mastertable.pk) as total,
otherfields
from mastertable

often does the job of giving back your totals and never demands much from
the server

Alan

> -----Original Message-----
> From: yeohray [mailto:yeohray@...]
> Sent: Monday, 19 May 2003 5:20 PM
> To: ib-support@yahoogroups.com
> Subject: [ib-support] Summary tables and triggers
>
>
> Is it safe to use triggers to update a summary table, everytime a
> value in the detail table changes? E.g. when a user confirms an
> order, the trigger will iterate through each line in the order and
> update a couple of summary tables accordingly. The confirmation flag
> is a field in the order header table, while the lines are in a
> separate table.
>
> I read a post previously that discouraged the use of triggers to do
> this, but does this still apply to Firebird 1.5 (since there appears
> to be some changes to how triggers work)?
>
> Thanks in advance.
>
> Regards
> Ray
>
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>