首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

关于mysql存储过程 cursor解决方法

2012-03-03 
关于mysql存储过程 cursor在mysql存储过程中,定义一个cursor在cursor里面:  有一个select field1 into var

关于mysql存储过程 cursor
在mysql存储过程中,
定义一个cursor
在cursor里面:
  有一个select field1 into vari1 from table where tindex = 0;
如果select * from table where tindex = 0不存在的话,
存储过程会自动将done 置为1,这个就退出了cursor,

请问各位:
如果不存在select * from table where tindex = 0的话,那么
select field1 into vari1 from table where tindex = 0;这条赋值语句该怎么写


[解决办法]
....
select field1 into vari1 from table where tindex = 0;
set done=0
...
[解决办法]

引用如果不存在select * from table where tindex = 0的话,那么
select field1 into vari1 from table where tindex = 0;这条赋值语句该怎么写

[解决办法]
建议贴出你完整的代码以便理解。

热点排行