db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Nielsen <Thomas.Niel...@Sun.COM>
Subject Re: Derby and offset
Date Fri, 04 Apr 2008 23:14:49 GMT
Hi Pertti,

Pertti Ylijukuri wrote:
> I have understood that in derby doesn't support offset in sql.
Correct. Derby does not support offset.
To my knowledge offset is actually not part of neither the SQL99 nor 
SQL2003 specs. Derby (attempts to) strictly adhere to these specs, and 
this is one of the main reasons why it's not supported.
> However in hibernate with derby this is possible using 
> Query.setFirstRow(int row). What it actually to do that?
Derby implements scrollable result sets, which is a requirement for 
Hibernate to provide Query.setFirstRow().
Please refer to any online JDBC tutorial, and/or the derby docs, on how 
to use scrollable resultsets.

Also, the upcoming derby 10.4 release includes the ROW_NUMBER() window 
function which is SQLs standardized way of limiting the number of rows 
returned and it's offset. Please see the following wikipage for a quick 
introduction in case you are unfamiliar with ROW_NUMBER():

Hope this helps :)


View raw message