I am trying to implement the equivalent of the "ON UPDATE CURRENT_TIMESTAMP" MySQL feature in sqlite. My idea it to use a trigger like this:
CREATE TRIGGER last_update_trigger
AFTER UPDATE
ON mytable
FOR EACH ROW
BEGIN
UPDATE mytable SET last_update = CURRENT_TIMESTAMP WHERE id = old.id;
END
But there's a problem with this. Each time an update occurs on a record of this table, the trigger triggers a new update on this same record. This should trigger the trigger again, and again, leading to an infinite loop of updates.
Is this really what will happen? Will the update in my trigger trigger the trigger again? Can I avoid triggering of triggers within triggers?