Table 1 has a price that is used to compute a total stored in table 3 by multiplying by a number of units in table 2
There is a trigger on table 1 updatethat revised a field on table 2 specifically to instigate an update in table 2(so if the price changes it will recompute the total)
There is a trigger on table 2 update that revises the total on table 3
Formula-Price(table 1) X units (table 2) = total (table 3)
When a change to the units in table 2 happens, the total in table 3 is recomputed via the trigger on update in table 2.
I want a change in table 1 to also execute the table 3 total - it is a very complicated trigger and I don't want to duplicate it on table 1 since there is no copy function for trigger specifics so i added an update flag on the table 2 that the trigger on table 1 sets true and that triggers the total update trigger on table 2. All works and records updated properly
but......
Problem is that the table 2 trigger doing the computation does not see the changed data in table 1.
Like the change to table 1 has not committed to the DB yet when the table 2 trigger is executed.
Is there a way to force the table 1 commit to the DB before trigger in table 2 executes?
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
sfa71
Table 1 has a price that is used to compute a total stored in table 3 by multiplying by a number of units in table 2
There is a trigger on table 1 update that revised a field on table 2 specifically to instigate an update in table 2 (so if the price changes it will recompute the total)
There is a trigger on table 2 update that revises the total on table 3
Formula- Price(table 1) X units (table 2) = total (table 3)
When a change to the units in table 2 happens, the total in table 3 is recomputed via the trigger on update in table 2.
I want a change in table 1 to also execute the table 3 total - it is a very complicated trigger and I don't want to duplicate it on table 1 since there is no copy function for trigger specifics so i added an update flag on the table 2 that the trigger on table 1 sets true and that triggers the total update trigger on table 2. All works and records updated properly
but......
Problem is that the table 2 trigger doing the computation does not see the changed data in table 1.
Like the change to table 1 has not committed to the DB yet when the table 2 trigger is executed.
Is there a way to force the table 1 commit to the DB before trigger in table 2 executes?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.