标签:declare 数据 end begin rom from procedure sql numbers
1.游标,MySQL游标只能用于存储过程
创建游标
CREATE PROCEDURE processor()
BEGIN
DECLARE ordernumbers CURSOR
FOR
SELECT order_num FROM order;
END;
2.打开和关闭游标
OPEN ordernumbers
CLOSE ordernumbers
3.使用游标数据
使用FETCH语句访问每一行
FETCH ordernumbers INTO o
标签:declare 数据 end begin rom from procedure sql numbers
原文地址:http://www.cnblogs.com/zhu-tingting/p/7588705.html