MySQL Forums
Forum List  »  Triggers

Re: Trigger is running equal to times, the no of columns updated in the row
Posted by: Peter Brawley
Date: September 15, 2014 01:10PM

The Trigger sets v_sequence_no to 1+ the biggest such value it can find, so if another user is writing a history record at the same time, you will get duplicates. To prevent this, use auto_increment.

Then for each of several column names, the Trigger sets v_column_name, v_column_value_new and v_column_value_old, each trio of SETs overwriting the last, so by the time the insert happens, your v_column_... variables hold just the last trio of such assignments.

BTW, names in caps are much harder to read than lower case.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Trigger is running equal to times, the no of columns updated in the row
1052
September 15, 2014 01:10PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.