xml-xsp-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otmar Vobejda <ot...@hcwerk.cz>
Subject How to recursively read from sql database
Date Wed, 05 Nov 2003 01:31:47 GMT
Hi, i'm a beginner in the Cocoon domain and first problem, what I'd like 
to solve, is recursive reading from database. For example you have a 
table test(id int, parent int, name varchar), where parent attribute 
points to id attribute of parent rows and you need to read all the rows 
to the tree.

for example something like this (excuse the syntax :):

// recursive function
public void readData (int parent) {
   select id, name from test where parent= $parent;
   for each result {
       print ($name);
       readData($id);
   }

// start recursion:
readData(null);

But how to write in XSP, when methods need to be in root <xsp:page> 
element and esql tags must be inside top user element (or how it is termed).

Thank a lot for each your outline!

osup



Mime
View raw message