Mysql存储过程的多参数问题 5
向student表添加新对象:delimiter//createprocedurestudent_add(inidint,innamevarchar,inchinesef...
向student表添加新对象:
delimiter //
create procedure student_add(in id int,in name varchar,in chinese float,in english float,in math float)
begin
insert into student values(id,name,chinese,english,math);
end
//
delimiter
报错如下:
ERROR 1064 (42000): 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 chinese float,in english float,in math float)
begin insert into student value' at line 1
求解
1、如何解决该错误?
2、由此可看出参数有何要求 展开
delimiter //
create procedure student_add(in id int,in name varchar,in chinese float,in english float,in math float)
begin
insert into student values(id,name,chinese,english,math);
end
//
delimiter
报错如下:
ERROR 1064 (42000): 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 chinese float,in english float,in math float)
begin insert into student value' at line 1
求解
1、如何解决该错误?
2、由此可看出参数有何要求 展开
展开全部
书写插入语句出错,字段附在表后,values后接真实数据
insert into student values(id,name,chinese,english,math);
insert into student values(id,name,chinese,english,math);
追问
也就是说这个存储过程无法向insert语句中传入参数咯!
如果存储过程中有多条更新语句岂不是不能用了吗?
请问:如何修改呢?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询