-- -------------------------------------------------------------------------------- -- Routine DDL -- Note: comments before and after the routine body will not be stored by the server -- ---------------------------------------------------------------…
一.创建游标 游标用declare语句创建.如下面的例子所示: create procedure test2() begin declare cursorTest cursor for select * from allIntersection; end; 二.打开.关闭游标 打开游标 open cursorTest; 关闭游标 close cursorTest; close 释放游标使用的所有内部内存和资源,因此在每个游标不再需要时都应该关闭.在一个游标关闭后,如果没有重新打开,则不能使用它.…