读书人

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

发布时间: 2012-03-03 15:33:02 作者: rapoo

关于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;这条赋值语句该怎么写

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

读书人网 >Mysql

热点推荐