声明游标
语法结构:
DECLARE cursor_name CURSOR FOR select_statement
描述说明:
游标就是通过该方式声明的。存储过程中可能有多个游标,但同一个代码块中的每个游标必须有唯一标识符。
将SELECT
查询结果关联到类似一个变量的游标中,但是这个查询本身并不是变量,结果也不是动态的。SELECT
语句中不能包含into关键字。
游标必须声明在HANDLER
s之前, CONDITION
s和局部变量之后。
Comments
Comments loading...
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.