cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Guettler <guet...@interface-business.de>
Subject Re: is <sql ... skip-rows="{@next}"> possible?
Date Tue, 02 May 2000 11:10:00 GMT
Thank you for your quick reply.
But LIMIT is mysql-spezific. Currently I could
use it, but we maybe want to switch to an other
database in the future.

tom stuart wrote:
> 
> On Tue, 2 May 2000, Thomas Guettler wrote:
> 
> > The following code does not work. {@skip} gets ignored.
> >   <query connection="www_odbc" max-rows="2" skip-rows="{@skip}">
> > Has some one an idear how to achieve this without xsp?
> > Why works the {@foo} inside the query, but not in the attributes?:
> 
> I can't speak authoritatively about the SQLProcessor (I haven't looked at
> the source yet) but presumably it only does this parameter interpolation
> on the contents of the <query> tag (ie. your query), but not the tag
> attributes. This makes a certain kind of sense, since you can redefine the
> variable-left-delimiter and variable-right-delimiter with the <query> tag
> attributes, which would make interpolation on the attributes themselves a
> bit self-referential.
> 
> The only obvious solution I can see is to implement the skip-rows
> functionality directly in your SQL query, as in:
> 
>         SELECT * FROM person WHERE id={@id} LIMIT {@skip},10
> 
> which will select 10 rows starting from row (skip+1).
> 
> I know this works with MySQL; YMMV.
> 
> -Tom
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Mime
View raw message