0

I've written following two triggers on a MySQL table which will get fire before insert and update operations :

IF (NEW.full_name = '') THEN SET NEW.full_name = NEW.user_name; END IF

Now what I want to do is whenever the if condition gets satisfied then the insert/update operation should get fail.

The statement

THEN SET NEW.full_name = NEW.user_name;

should not get execute.

How should I achieve this? Please someone help me.

Thanks in advance.

PHPFan
  • 4,300
  • 13
  • 57
  • 117
  • @Marc B : That scenario is different. I want answer for my situation. Please don't relate my question to some other question. – PHPFan Sep 01 '15 at 14:12
  • doesn't matter what your scenario is. the situation is the same: you need to abort a trigger, and that question/answer shows you how. – Marc B Sep 01 '15 at 15:43

0 Answers0