读书人

编纂存储过程时出现:Recursive store

发布时间: 2012-07-05 07:59:17 作者: rapoo

编写存储过程时出现:Recursive stored functions and triggers are not allowed.
最近在学习mysql的存储过程,编写实例时出现这个错误:Recursive stored functions and triggers are not allowed.请问怎么解决呢?代码如下:
BEGIN
#Routine body goes here...
IF n>=2 THEN
RETURN n*factorial(n-1);
ELSE
RETURN n;
end if;
END

[解决办法]
存储过程不能return
[解决办法]
函数才能用return
[解决办法]
MYSQL中函数不允许使用递归调用,仅在存储过程中可以递归调用。

读书人网 >Mysql

热点推荐