mysql> create procedure pro() begin end;
Query OK, 0 rows affected (0.00 sec)
可以成功执行,begin end 之间什么都没有在里面添加操作语句
mysql> create procedure pro() begin select * from person; end;
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 'selec
t * from person' at line 1
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 'end'
at line 1
反正begin 里面填入什么东西都无法执行通过。什么问题啊,纠结。。
mysql> create procedure pro() begin
  -> insert into person values(1,'aname',2); end;
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 'inser
t into person values(1,'aname',2)' at line 2
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 'end'
at line 1person 表结构: (id int , name varcha(10), age int);