开发者

What's wrong with this MySQL trigger?

开发者 https://www.devze.com 2023-04-07 01:41 出处:网络
So what is wrong with this trigger? MySQL is only nice enough to tell me it is a 1064 error. DELIMITER |

So what is wrong with this trigger? MySQL is only nice enough to tell me it is a 1064 error.

DELIMITER |

CREATE TRIGGER new_member BEFORE INSERT on member
FOR EACH ROW BEGIN
    INSERT INTO party(PartyId, PartyTypeCode, DateCrea开发者_高级运维ted, DateUpdated) 
     VALUES(New.PartyId, ’M’,now(), now());
END;
|

DELIMITER ;


I'd guess that your problem is the non-ASCII quotes in your VALUES:

VALUES(New.PartyId, ’M’,now(), now());
-- -----------------^

Try using plain old single quotes like SQL expects:

VALUES(New.PartyId, 'M', now(), now());
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号