Re: SQL Question
Posted in 2003
The only depth testing I've ever done was back on 7.12 and the limit was 12 (ish) and the decision was made to set the 'standard' max at 10. Never got round to testing again. The only time it looked like I might need to retest was when we setup our cdi search, but we used the node blade instead Paul "Mark D. Stock" wrote: > > Paul Watson wrote: > > You could merge get_hierachy and get_child into a single SPL, just > > call the top level get_child with your starting point and a depth of > > zero. Only one to maintain/document (??) > > Yup. Plus you could raise an exception on exceeding your levels limit, > which would return a 'real' error to your app. I think you should be able > to process more levels, but YMMV. > > > "Kapur, Rajesh" wrote: > > > >>Mark: Thank you very much.... I was able to find your SPL snippets and customize your code to my needs.... I include the details of what I have done, in case someone else can benefit from it... > >> > >>* The first stored procedure get_hierarchy() extracts the nodes with no parent. (I had to write a separate procedure because I had nulls in the parent_id field for the nodes with no parent. With a little work, we can probably get the same results with a single stored procedure.) > >>* get_hierarchy calls get_child for each node with no parent. get_child recursively prints out all lower levels. > >>* I included the description of each level. > >>* I added a depth indicator and a check not to exceed 10 levels of recursion. > >>* I included indentation of each level, based upon the depth level. > >>* Table description, SPL code and sample output are included. > > Excellent! > > Cheers, > -- > Mark. > > +----------------------------------------------------------+-----------+ > | Mark D. Stock mailto:mdstock@MydasSolutions.com |//////// /| > | Mydas Solutions Ltd http://MydasSolutions.com |///// / //| > | +-----------------------------------+//// / ///| > | |We value your comments, which have |/// / ////| > | |been recorded and automatically |// / /////| > | |emailed back to us for our records.|/ ////////| > +----------------------+-----------------------------------+-----------+ > > sending to informix-list -- 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 #