Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Fetching from a hierarchical data structure?

Re: Fetching from a hierarchical data structure?

From: Maury Markowitz <maury_at_remove_this.sympatico.ca.invalid>
Date: Mon, 09 Apr 2001 15:19:11 GMT
Message-ID: <PpkA6.65352$XV.16174335@news3.rdc1.on.home.com>

"Jan Hidders" <hidders_at_REMOVE.THIS.win.tue.nl> wrote in message news:9aljiq$g37$2_at_news.tue.nl...
> I assume you have a good reason why you compute the identifiers first
> and then generate a query that explicitly mentions them instead of
> simply computing them directly in the SQL query itself.

  Yes, I don't know how. I guess this is what I'm really asking for, how to do this in the SQL side of things. The data structure is a pure tree, with each row listing a (option) pointer back to it's parent.

 What I'd like to do it get the list of leaf accounts for any account (which may be a leaf to start with) purely in SQL. I simply don't know how. And from the other comments I've seen, that may be because it's very difficult to do on anything other than Oracle.

  I suppose this is a common problem, so perhaps there's a textbook solution "out there", but I haven't found it yet.

> Otherwise I would suspect that this is a case of sloppy
> design by someone who is afraid of complicated SQL queries.

  Yes, me. I'm a Java guy, my SQL is limited.

> As you can see this is shorter and with 50 items in both trees you
> would have 50*50*2=5000 terms in the disjunctive normal form and
> "just" 50+50=100 terms in the conjunctive normal form.

  This still appears to be over the Sybase limits however, at least with the trees of several hundred leafs that our customers use.

Maury Received on Mon Apr 09 2001 - 10:19:11 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US