You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nicholas Hemley <ni...@realtime.co.uk> on 2000/06/13 18:29:26 UTC

Does the SQLProcessor support loops?

I would like to define an XML query to loop through and insert values
from a parameter list into a DB table (currently I do it in java code)

            //and re-add the chosen ones
            for(int i = 0; i < near_values.length; i++)
              st.executeUpdate("insert into locations_near
(location_id,locNear_id) values (" + id + "," + near_values[i] + ")");

Essentially, i would like to replace all java code with xml query equivalents.

--
Nic Hemley

www.realtime.co.uk
Tel: 0208 544 5226




Re: Does the SQLProcessor support loops?

Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 13 Jun 2000, Nicholas Hemley wrote:

> I would like to define an XML query to loop through and insert values
> from a parameter list into a DB table (currently I do it in java code)
> 
>             //and re-add the chosen ones
>             for(int i = 0; i < near_values.length; i++)
>               st.executeUpdate("insert into locations_near
> (location_id,locNear_id) values (" + id + "," + near_values[i] + ")");
> 
> Essentially, i would like to replace all java code with xml query equivalents.

You could probably do something similar to this using XSP taglibs.

- donald