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

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

关于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存储过程 cursor解决方法

相关文章:

你感兴趣的文章:

标签云: