If you don't understand something in that example, post there your question.
Zhavic
--------------------------------------------------------------- In the 1960s you needed the power of two Comodore64s to get a rocket to the moon. Now you need a machine which is a vast number of times more powerful just to run the most popular GUI.
Umm to create a recursive stored procedure you just have the SP call itself from with inside itself
The only issues you have to do with is that you'll get warnings from the parser that the SP doesn't exsiste when you first create the SP and the nesting level as you can only go 32 levels deep in stored procs.
Hope I've been helpful,
Wayne Francis
If you want to get the best response to a question, please check out FAQ222-2244 first
sefafo, in SQL you have to look on RECURSIVE programing by another way.
In other languages, like C++ when you call some function recursive, it stores all variables into stack and after execution of function it pop data from stack and you have not limit on size of that stack ( expect memory or some special setting, but I am sure it is not only 32 leveles )
In SQL you have to program your own stack by using temporary table and go throught loop as in that example I post link to. And in that case, there is great command GOTO label which can be used to control where to return after one 'nested' loop if you need recursive calls from more than one place ( you simply store return_label into stack together with other variables you want, and at the end, you pop up them and do GOTO return_label )
Post there in concrete what you are want to do and we can show same example.
Zhavic
--------------------------------------------------------------- In the 1960s you needed the power of two Comodore64s to get a rocket to the moon. Now you need a machine which is a vast number of times more powerful just to run the most popular GUI.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.