cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: built sql query
Date Mon, 10 Jul 2000 17:56:37 GMT
On Mon, 10 Jul 2000, Torsten Curdt wrote:

> I know now how to do and display a sql query with cocoon.
> But can anyone show me a good way to do a built query?
> 
> I mean a query that is modified by the parameters passed
> to the page (a very common task)
> 
> something like:
> 
> show.xml?id=50 -> select * from sometable where tableid=50
> 
> actually the question is: how can I pass my java built
> sql string to the sql processor?

you want to use the sql logicsheet. read
http://xml.apache.org/cocoon/sqltaglib.html. an example:

<sql:execute-query>
 ...
 <sql:query>
  select * from sometable where tableid=<request:get-parameter name="id"/>
 </sql:query>
</sql:execute-query>

for your own java built string:

<sql:execute-query>
 ...
 <sql:query>
  select * from sometable where tableid=<xsp:expr>myMethod()</xsp:expr>
 </sql:query>
</sql:execute-query>

- donald


Mime
View raw message