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.

PHPLover
  • 1
  • 51
  • 158
  • 311
  • @Marc B : That scenario is different. I want answer for my situation. Please don't relate my question to some other question. – PHPLover 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