cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: recursion & sql in xsp
Date Tue, 29 Aug 2000 21:19:08 GMT
On Tue, 29 Aug 2000, Steve Conover wrote:

> Another problem:
> 
> I have a generic category tree stored in a table, like this
> 
> catgid	catgname	catgparentid
> 0		root		0
> 1		blue		0
> 2		red		0
> 3		orange	2
> 4		green		1
> 
> 
> Imagine there are 20+ levels in my hierarchy...I need to design something in
> xsp to start with a catgid, make a sql call, get that category's parentid,
> and feed it back to the same sql call until it reaches the root id (0).  All
> the while I need to construct some xml that reflects the hierarchy.  

hmm, that's a kinda tricky one - unlike the classic department/employee
example, you don't even know how deep the nest is going to be - which
means you can't even use the new esql logicsheet to do it afaict. you're
probably best off writing a little logicsheet to do this using straight up
JDBC.

- donald


Mime
View raw message