Advertisement
mOrloff

CONCAT in Trigger

Oct 17th, 2012
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.39 KB | None | 0 0
  1. CREATE TRIGGER set_aka_name
  2. BEFORE INSERT ON sandbox_person
  3. FOR EACH ROW
  4. BEGIN
  5.   IF (NEW.aka IS NULL) THEN
  6.     NEW.aka = CONCAT(NEW.fname, ' ', NEW.lname);
  7.   END IF;
  8. END
  9.  
  10. ## Throwing this ERROR:  #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.aka = CONCAT(NEW.fname, ' ', NEW.lname)' at line 6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement