Subject RE: [firebird-support] recursive procedure
Author Jarrod Hollingworth
Hi Mitchell,

I posted a similar solution a while back (can't remember if it was to this
list or a borland.public... newsgroup) as I do this in my time tracking
software (http://www.complete-time-tracking.com). Essentially you need to
make your inner SELECT a FOR SELECT and add a SUSPEND in the loop - ie.
explicitly return all rows found. I haven't checked the rest of your code
thoroughly but it was a little tricky to get it working well. Some other
comments:

You often want to order the category tree by description. Therefore it is
useful to return a row index column (sequential number for each row
returned) so that clients can join the results of the stored proc with other
tables and maintain the correct tree order. Additionally I also found it
useful to return a "tree level" value, useful for doing programmatic
indentation in reports and so on.

Regards,
Jarrod Hollingworth
Backslash