user198729
user198729

Reputation: 63636

About MySQL's trigger

I know it's available since version 5.1,but :

  1. Is it stable?
  2. Is it possible to trigger event when there is insert/update operation on specific columns instead of the whole table?

Upvotes: 1

Views: 160

Answers (2)

sibidiba
sibidiba

Reputation: 6360

  1. To my experience, yes.
  2. Trigger functionality is very limited. You have FOR EACH ROW option but no WHEN. It is also very limited what you can do inside the trigger. If you expect the requirements to change later (i.e. the project will go on), I would not opt to do business logic in mysql triggers. If it contains some simple check or consistency update it can do a good job.

Upvotes: 0

raveren
raveren

Reputation: 18542

  1. To my experience, yes, totally
  2. Not exclusively, but you can add a check in the body of the trigger: IF(OLD.col <> NEW.col, ...)

Upvotes: 2

Related Questions