DeltaDrizz
DeltaDrizz

Reputation: 51

MySQL Scheduler on update

Is it possible to let the scheduler "hear" for an update of a specific table? E.g. I have 2 tables, t1 and t2, and I update a row in t1, I would like to run an update in t2, right after it.

Upvotes: 1

Views: 25

Answers (1)

Yigit Tanriverdi
Yigit Tanriverdi

Reputation: 964

You can use trigger for update your secon table.

CREATE TRIGGER trigger_name  
AFTER UPDATE ON t1 FOR EACH ROW
BEGIN

   -- variable declarations

   -- trigger code

END;

You can see examples on this website

Upvotes: 2

Related Questions