cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henning von Bargen <H.vonBar...@Triestram-Partner.de>
Subject AW: hierarchical resultsets & xml
Date Tue, 08 Aug 2000 06:55:05 GMT
> -----Urspr√ľngliche Nachricht-----
> Von:	Raj Basavaraju [SMTP:raj@bidland.com]
> Gesendet am:	Dienstag, 8. August 2000 00:43
> An:	cocoon-users@xml.apache.org
> Betreff:	Re: hierarchical resultsets & xml
> 
> Steve Conover wrote:
> 
> > H everyone,
> >
> > For the last week I've been trying to solve the problem of how to write
ONE
> > sql query, and get back a resultset that can be looped thru and
translated
> > into XML.  And I want to use XSP/Cocoon.
> >
> > It appears that the root of the problem is that JDBC doesn't do
hierarchical
> > recordsets (I don't think it's in jdbc 2.0 either - does anyone know
this
> > for sure?).  So I can't directly construct a query that brings back
> 
> You are right, even jdbc 2.0 doesn't handle hierarchical recordsets.
> 
> > department 1
> >         Employee 1
> >         Employee 2
> > department 2
> >         Employee 3
> >         Employee 4
> > etc...(that wouldn't use standard sql anyway, it'd be oracle-specific)
> >
> > So my question is, can all of you who have dealt with this problem
impart
> > some of your wisdom?  Do you go thru several xsp steps (run query, get
> > departments, for-each department, run query to get employees, etc)?
What's
> > the most elegant way of doing this?  Any performance gotchas to look out
> > for?
> 
> Can you use hierarchical query something like:
> 
>   select rpad(' ',level*3)||surname employee
>   from employees
>   start with mgr_id = 0
>   connect by prior emp_id = mgr_id;
> 
> Best regards.
> 
> Raj

Seems not a good idea to me.
Performance isn't good for this kind of query, 
and IMHO the intention of the connect by prior syntax is for forest data
structures
with trees of arbitrary depth (like in the well-known employee-manager
example above).
Joining different tables which have a foreign-key constraint this way seems
to be mis-use.
Henning

> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Mime
View raw message