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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -