Subject | Maintain Summary Table with Database Trigger |
---|---|
Author | JackR |
Post date | 2010-07-23T04:30:20Z |
I have a database with a master-detail-subdetail relationship. If a user changes the details or subdetails via a query tool, I want to set a flag that indicates that a summary table is out of date. But when my program updates the database, it will insert, delete or update several thousand details and subdetails.
It seems like a table trigger would serve well in the first instance, but it would be inefficient in the second. It would be great if I could set a database trigger that on commit could determine that there had been a change to the detail or subdetail table and set the flag.
I have been doing this with a trigger on the table but I have not really checked to see if it is slowing the inserts from my program. Maybe this is a non-issue.
Assuming that it is not a non-issue, is there a way to configure a database trigger to do this update?
Thanks for your help.
It seems like a table trigger would serve well in the first instance, but it would be inefficient in the second. It would be great if I could set a database trigger that on commit could determine that there had been a change to the detail or subdetail table and set the flag.
I have been doing this with a trigger on the table but I have not really checked to see if it is slowing the inserts from my program. Maybe this is a non-issue.
Assuming that it is not a non-issue, is there a way to configure a database trigger to do this update?
Thanks for your help.