Mysql存储过程,插入新项后返回自动编号
tg01 2019-05-05 07:03:04 mysql 5.5 phpadmin
语法改了吗?试错试到脑壳痛
USE school;
DROP PROCEDURE IF EXISTS `aa`;
CREATE PROCEDURE aa(
IN bb INT,
OUT dd INT)
MODIFIES SQL DATA
BEGIN
INSERT INTO zx_class(class_name)
VALUES(bb);
SET @dd = LAST_INSERT_ID();
SELECT @dd;
END
#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 '' at line 7