dropprocedureifexists update_user_by_id; delimiter $$ createprocedure update_user_by_id ( IN p_id int, IN p_name varchar(18), IN p_sex varchar(19), IN p_age int ) begin update tb_user setname=p_name,sex=p_sex,age=p_age whereid=p_id; end $$ delimiter ;
dropprocedureifexists update_user_by_id; delimiter $$ createprocedure update_user_by_id ( IN p_id int, IN p_name varchar, IN p_sex varchar(19), IN p_age int ) begin update tb_user setname=p_name,sex=p_sex,age=p_age whereid=p_id; end $$ delimiter ;
错误提示如下:
1 2 3 4
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 ' IN p_sex varchar(19), IN p_age int )