ThinkCode
ThinkCode

Reputation: 7961

How to MySQL Trigger to update a field whenever any record is touched?

I haver zero experience with triggers in MySQL. Learnt them in school (Oracle environment).

I have a table which already has a datestamp column for insert date.

I want to update a Record_Touched field whenever any record is touched in this table. What is the best efficient way of doing it?

Thank you...

Upvotes: 2

Views: 864

Answers (1)

Gary
Gary

Reputation: 2916

Create that field as a TimeStamp and set ON UPDATE CURRENT_TIMESTAMP

As described, I do not believe that you need a Trigger.

Upvotes: 2

Related Questions