Six Fried Rice wrote:
> On Apr 28, 2008, at 8:02 AM, Rick Hillegas wrote:
>
>> The new 10.4 release provides support for the sql standard ROW_NUMBER
>> function, which you can use for paging through query results. You can
>> find this function documented in the ROW_NUMBER subsection of the
>> "Built-in functions" section of the 10.4 Reference Manual.
>
> Thanks for the info. I have another developer working on this part,
> and he reports that, ie, this query:
>
>> select * from (select row_number() over() as rownum,
>> table_occurrence.* from table_occurrence) as temp where rownum>=1 and
>> rownum<=10
>
> Works as expected when executed through the IJ console. But when
> executed through the JDBC application, he gets this error:
>
>> 1147 FATAL [http-8080-Processor25]
>> com.sixfriedrice.lumen.ddrserver.utility.BuildQuery - Error in query
>> :java.sql.SQ
>> LSyntaxErrorException: Syntax error: Encountered "(" at line 1,
>> column 40.
>
> Does that make sense to anyone?
Hi Geoff,
That's the error you'll get if you execute the query in a Derby release
that doesn't support the ROW_NUMBER function (e.g., Derby 10.3). So I
would have double checked that the JDBC application in fact uses Derby
10.4. derby.log should tell you which version was used.
--
Knut Anders
|