Question

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;
Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top