OK, here's the documentation from Postgres and MySQL for the limiting select
statement...
http://www.postgresql.org/docs/postgres/sql-select.htm
http://www.mysql.com/documentation/mysql/commented/manual.php?section=SELECT
They both support limiting the number of rows returned, and the starting
row.
This is also supported by BasePeer (using village)...which you can see here:
http://www.working-dogs.com/turbine/cvsweb/index.cgi/turbine/src/java/org/ap
ache/turbine/om/peer/BasePeer.java?rev=1.1.1.1&content-type=text/x-cvsweb-ma
rkup
Look at the third getSelectResults function....
Sybase and SQL/Server support limiting rows using SET ROWCOUNT, but they
can't support the starting row SQL/Server 7 has SELECT TOP, but in turbine
we use a Sybase adaptor for SQL server, and the SET ROWCOUNT is supported by
Sybase and all versions of SQL/Servler.
What if we put in the criteria setStartRow and setNumberOfRows, and then in
the DB, supportsNativeLimit, and supportsNativeOffset.
Then in BasePeer, when they have those things set in the criteria, if the DB
supports it all natively, then we'll build the query that way, otherwise,
we'll use the functionality from Village/JDBC, by calling the
getSelectResults which takes the startRow and numberOfRows parameter.
That way, the functionality will be supported in Turbine for all databases,
and we'll use the custom syntax for the databases which support it.
-Nissim
> -----Original Message-----
> From: Daniel L. Rall [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 04, 2000 7:26 PM
> To: Turbine
> Subject: Re: PROPOSAL: Limiting resultsets with Criteria and BasePeer
>
>
> Leon Messerschmidt wrote:
> > [snip]
> > Now we can just let it fall through and let Village handle
> the rest. I suspect
> > Village cycles through the resultset <NumRows> times.
> Because the actual data is
> > only transported once you ask for it this could give you
> the desired effect, it
> > think?
> >
> > Might be a little slower that using a native LIMIT
> statement, but we can use it
> > over *any* database that is currently supported.
> >
> > Any thoughts?
>
> I think that this cross-database support that is built into
> Turbine adds
> quite a bit of value and that we should continue to support it, as you
> suggest here. +1
> --
>
> Daniel Rall <[EMAIL PROTECTED]>
> http://collab.net/ | open source | do the right thing
>
>
> ------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?: [EMAIL PROTECTED]
>
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]