ESQL elements don't have to be inside the top user element, at least in
C2.0. We use ESQL in user-defined functions all the time. This wasn't the
case in C1, as it used local variables in the generate() method, but now
all its variables are declared at the object level, and just initialized in
the generate() method.
I take it you are using a database other than Oracle? Oracle provides
support for this kind of tree relationship in SQL (using the CONNECT BY
clause).
-Christopher
|---------+---------------------------->
| | Otmar Vobejda |
| | <[EMAIL PROTECTED]>|
| | |
| | 11/05/2003 04:47 |
| | AM |
| | Please respond to|
| | users |
| | |
|---------+---------------------------->
>--------------------------------------------------------------------------------------------------------------|
|
|
| To: [EMAIL PROTECTED]
|
| cc:
|
| Subject: Recursive reading from database
|
>--------------------------------------------------------------------------------------------------------------|
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]