Re: Using procedures to maintain derived data
Posted in 1995
In article: <46lif9$pcb@redstone.interpath.net> Mike Lemon <mdl@interpath.com> writes: > Anyway, gripe mode off. Anyway, my limited exposure to triggers and SPL > seems to indicate that in order to keep a header record updated with respect > to its detail, an update trigger on the appropriate detail fields is in > order. Ideally, one would specify an after() clause to update the header > once after all the detail records have been updated. Since multiple records > are going to be modified, and they are in no way required to be from the same > master-detail relationship, I run into the dilemma of specifying which > headers need to be recalculated. The only way I can see to do this is to > update the header for each row. This seems to be an untenable solution for > the size of the dataset I'm dealing with, although I haven't tested it yet. > > My other option is to accumulate a list of all headers which require updating > while processing each detail update, but SPL is conveniently devoid of array > capabilities. > > Am I missing something here? Neither the 5.02 nor the 7.1 online engine > seems to provide any functionality to handle this kind of situation easily. > True, good normal form theory decries derived data, but this is a real life > situation, and such fields are necessary to performance and ease of use. > > Can anyone help? Many thanks in advance. > > -- > > Mike Lemon > mdl@interpath.com > > > > Their is always the posibility of not using calculated fields. You could have the header record, not including any totals from the details. Then use a view (for convienience) to calculate the fields you want. Mail me if you want details on how you would do it. -- Mike Aubury -- Mike Aubury