November 22, 2003 at 9:24 am
I am having a baffling issue and I was wondering if someone here can throw some light on this.
I have a table say member table. I have two triggers on it -an insert trigger and an update trigger.
Whenever somebody inserts record from an application (that first inserts a record with the unique id as 0 and then updates the record with the next available highest sid, all as a single transaction), the update trigger fires 2 times and then the insert trigger gets fired.
I understand that the application is poorly designed, but the app was designed in 1997 and is due for upgrade, so let us keep it aside. But how can the update trigger get fired (and that too 2 times), before even the record is inserted?
I know the sequence of triggers getting fired because, in both these triggers, I have made it add a new record in a test table with the time stamp, the trigger name/type and the inserted/updated values.
Any thoughts?
November 24, 2003 at 7:31 am
Perhaps the app is firing an 'update' that isn't changing the values of an existing row (it'll still fire even with no real data value changes)? Never heard of/seen a trigger firing on a record that isn't there- seems impossible. Any foreign keys or check constraints involved?
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply