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

编写存储过程时出现: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中函数不允许使用递归调用,仅在存储过程中可以递归调用。