mysql> create procedure processorders()
-> begin
-> DECLARE ordernumbers CURSOR
-> FOR
-> SELECT order_num from orders;
-> end //
Query OK, 0 rows affected (0.02 sec)
```创建游标过程无问题。
```sql
mysql> open ordernumbers;
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 'open ordernumbers' at line 1
之后执行open操作,一直报错。
百度没有找到有效的解决办法,直接去翻看SQL官方文档也搞不清是哪里写错了。