Problem with recursive call of Stored Procedure



In trying to run recursive call of a stored procedure, I get this error message:
"ERROR 1456 (HY000): Recursive limit 0 (as set by the max_sp_recursion_depth variable) was exceeded for routine pickup_HolidaysCheck"
I am using version 5.0.17, which is supposed to allow recursive calls.
Can anyone tell me how to fix this?

I am using version 5.0.17, on Mac OS X 10.4

Many tanks in advance.

javaQQAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

todd_farmerCommented:
Haven't tried this myself, but have you attempted to put the following in your my.cnf file:

max_sp_recursion_depth=5

(or whatever level of recursion you need)?
todd_farmerCommented:
Also, it appears that this can be set dynamically:

set @@max_sp_recursion_depth=5;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
javaQQAuthor Commented:
Hi Todd;

I tried your suggestion:

mysql> set @@max_sp_recursion_depth=5;
Query OK, 0 rows affected (0.26 sec)

However I still got the same error message: "ERROR 1456 (HY000): Recursive limit 0 (as set by the max_sp_recursion_depth variable) was exceeded for routine pickup_HolidaysCheck"

This seems to have fixed that problem:

mysql> set @@max_sp_recursion_depth=5; |
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH TABLES |
Query OK, 0 rows affected (0.14 sec)

I am not experienced in manipulatinng the configuration variables -- for example, I have not been able to find the my.cnf file -- so if you can give me (or point me toward) some more detailed instructions I would greatly appreciate it.
todd_farmerCommented:
Information on the options file (my.cnf) is located here:

http://dev.mysql.com/doc/refman/5.0/en/option-files.html

I don't know that the max_sp_recursion_depth variable can be set there; but it makes sense.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.