日期:2014-05-16  浏览次数:20762 次

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

------解决方案--------------------
建议贴出你完整的代码以便理解。