my schema is middleweight(mname, mwins, mlosses, mdraws, mweight, mcountry, mage, mheight) I am completely lost cant seem to find the problem.

delimiter//
CREATE TRIGGER tr_middlewegiht_u
BEFORE update on middleweight
for each row
begin
          IF (new.mweight>185) THEN
             SIGNAL sqlstate '45000'
                  set message_text = 'The fighters in the wrong weight class.';
               END if;
END//
delimiter;
有帮助吗?

解决方案

You should maintain a space between 'delimiter' key word and its values '//', and ';'
Unless which it is a 1064 syntax error.

Example:

delimiter // -- <--- observe the space here. It is a MUST

-- your trigger definition

end;

//

delimiter ; -- <--- maintain space here too. This too is a MUST
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top