> Ben, your message bolstered my courage to
> tackle this - kinda' humorous that a discussion
> of hierarchical data and a nested-sets
> implementation might "inspire" someone.
As a friend of mine once said to a similar comment, "Ben, that's just
sad" <g>.
I regret to say that when I've used this logic in the past I had the
luxury of starting from scratch (no data conversion), and most recently
in VB, but with different objectives, so I can't offer much help.
Looking at his "push down stack algorithm" just makes my head hurt w/o
more time to digest it.
I can offer this *very* modest advice, fwiw. It became much easier for
me to internalize when I reflexively knew that if the two indexes were
sequential the data item had no children, otherwise other data sets were
encapsulated. I know it's obvious... and I can't explain why it seeing
it just that way greased my mental skids, but there you are (more
sadness, I guess <g>).
I had originally seen this method in a posting on this list long ago. I
just Googled "celko sql tree" to get something explanatory for you.
There are a bunch of matches and I recall seeing this applied in a
number of different ways when I looked into it some years ago, so there
may be more help there. But, it sounds like you've almost got it whipped.
Ben