我想用一段时间创建一个过程,但出现错误。

这是我的程序:

Delimiter //
create procedure procedure1 ()
 BEGIN
Declare i INT;
set i=1;
while i< 74 do
execute immediate 'insert into main values(3,"samples")'
set i=1+1;
end while;
 end //


我收到这个错误

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that on for   the right syntax to use near ''insert into main values(3,"samples")'


有人有主意吗?

最佳答案

按照以下步骤更改插入查询

insert into main values(3,'samples')

10-08 19:45