drop procedure if exists update_user_by_id;
delimiter $$
create procedure 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 set name=p_name,sex=p_sex,age=p_age
where id=p_id;
end
$$
delimiter ;
dropprocedure if exists 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 set name=p_name,sex=p_sex,age=p_age where id=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 )