Re: SQL Question
Posted in 2003
I should have added with the SPL approach you must add a depth gauge, AFAIK the engine should stop recursion at a depth of 32, wouldn't know for sure as the instance always goes before that. We hardcode a depth of 10 in our recursive SPL. Jonathan Leffler wrote: > > Mark Townsend wrote: > >> Unfortunately no other SQL implementation has added that feature > >> so you'll have to implement it in code in you app or in an SPL. > > > > Hmm - well, IBM DB2 HAS implemented recursive common table expressions > > (which IS in the standard and IS potentially a better implementation > > that what we implemented in Oracle many,many years ago). Of course, I > > don't believe that Informix has implemented this yet. > > Correct, though as Paul Watson mentioned, both SPL and the Node > Datablade can be used to achieve the same result. > > > How's that for truth in advertising ? > > Not bad! > > My understanding (based on second-hand knowledge and hence subject to > correction) is that the limitations on CONNECT BY PRIOR etc are quite > severe - and the result isn't a relation since the order of the data > is critical. However, even that is arguably better than nothing. > > > Recursive CTE's are actually pretty cool - see > > http://www7b.software.ibm.com/dmdd/library/techarticle/0307steinbach/0307steinbach.html#section1 > > for a discussion of them, and how they relate to Oracle's CONNECT BY > > capabilities. > > Or http://tinyurl.com/tux0 > > -- > Jonathan Leffler #include <disclaimer.h> > Email: jleffler@earthlink.net, jleffler@us.ibm.com > Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/ -- Paul Watson # Oninit Ltd # Growing old is mandatory Tel: +44 1436 672201 # Growing up is optional Fax: +44 1436 678693 # Mob: +44 7818 003457 # www.oninit.com #