Mysql5.7创建存储过程中调用自定义函数报错Not allowed to return a result set from a function

Mysql5.7创建存储过程中调用自定义函数报错Not allowed to return a result set from a function

Mysql5.7创建存储过程中调用自定义函数报错Not allowed to return a result set from a function
因为很多存储过程都会共用一段sql语句,所以我把共用的sql封装成一个自定义函数 AddCapital(); 然后通过存储过程调用,创建存储过程会报错1415,Not allowed to return a result set from a function(不允许从函数返回结果集);因为存储过程返回值为int,你可以定义一个变量接收一下函数的返回值;再执行就没问题了。
Mysql5.7创建存储过程中调用自定义函数报错Not allowed to return a result set from a function
Mysql5.7创建存储过程中调用自定义函数报错Not allowed to return a result set from a function
本文转自:https://www.cnblogs.com/dajiangge/p/10107450.html
感谢博主的帮助

欢迎点赞关注收藏哦 ,码云搜索KakiNakajima