哪种是正确的声明游标的方法?

时间:2019-10-21 13:15:56

标签: mariadb

我正在mariadb中创建一个游标,但是会发生一些错误,所以请告诉我怎么做
    我可以解决这个错误

 create table o_rollcall(roll_no int (3),name varchar(30));
 insert into o_rollcall values (1,'safwan'),(2,'abc'),(3,'xyz');
 create table n_rollcall(roll_no int (3),name varchar(30));
 insert into n_rollcall values (1,'safwan');


MariaDB [c]> declare
-> cursor cur1 for select roll_no,name from o_rollcall;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual   
that corresponds to your MariaDB server version for the right syntax to   
use near 'declare
cursor cur1 for select roll_no,name from o_rollcall' at line 1

0 个答案:

没有答案