This is a read-only copy of the MariaDB Knowledgebase generated on 2024-12-03. For the latest, interactive version please visit https://mariadb.com/kb/.

声明游标

语法结构:

DECLARE cursor_name CURSOR FOR select_statement

描述说明:

游标就是通过该方式声明的。存储过程中可能有多个游标,但同一个代码块中的每个游标必须有唯一标识符。

SELECT 查询结果关联到类似一个变量的游标中,但是这个查询本身并不是变量,结果也不是动态的。SELECT 语句中不能包含into关键字。

游标必须声明在HANDLERs之前, CONDITIONs和局部变量之后。

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.