stored procedures - MySQL CREATE TRIGGER, Syntax Error. What I'm doing wrong? -
delimiter || create trigger `monthly_insert` before insert on `history_monthly` each row begin new.`uid` = concat(old.`year`, old.`month`, old.`charactersid`); end; || delimiter ;
and returns error:
#1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near '.`uid` = concat(old.`year`, old.`month`, old.`charactersid`); end' @ line 4
it's first time triggers , doing best try find soultion failed ;<
you need add word set
in line:
set new.`uid` = concat(old.`year`, old.`month`, old.`charactersid`);
also, commenter pointed out, there no old
value in before insert
trigger.
Comments
Post a Comment