在 SQL WORKBENCH 中输入DELIMITER // 没有反应,输入新建函数后报错(8.0.13)
代码如下:
DELIMITER //
CREATE FUNCTION aduser (username varchar(20))
RETURNS INT unsigned
BEGIN
INSERT test(username) VALUES (username)
RETURN LAST_INSERT_ID( );
END
//
报错如下:
Error Code: 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 'RETURN LAST_INSERT_ID( )' at line 5