Bruce,
wg> -----Original Message-----
wg> From: Bruce Snyder [mailto:[EMAIL PROTECTED]
wg> Sent: Tuesday, May 17, 2005 5:28 AM
wg> To: [email protected]
wg> Subject: Re: [castor-user] [JDO] LIMIT with oracle?
wg>
wg>
wg> On 5/16/05, Eric Anderson <[EMAIL PROTECTED]> wrote:
wg> > What is the correct syntax? I tried the following
wg> >
wg> > SELECT p FROM org.usiis.struts.PatientSearchForm p LIMIT
wg> $1 ORDER BY
wg> > p.lastName
wg> >
wg> > but got
wg> >
wg> > org.exolab.castor.jdo.oql.OQLSyntaxException: An
wg> incorrect token type
wg> > was found
wg> > near ORDER (found KEYWORD_ORDER, but expected END_OF_QUERY)
wg>
wg> Eric,
wg>
wg> This is because the statement is not structured correctly. Try
wg> following the example in the release notes
wg> (http://castor.codehaus.org/release-notes.html). Please
wg> notice that I
wg> had to fix the example slightly:
wg>
wg> select a from Account a order by a.id limit $1 offset $2
wg>
wg> Notice that the LIMIT (and OFFSET if you decide to use it) must come
wg> after the ORDER BY clause.
wg>
wg> I didn't actually write this code and I don't have access
wg> to Oracle at
wg> this time. It can also be helpful if you could enable the following
wg> property in the castor.properties file:
wg>
wg> # True if proxy classes should be used for JDBC connections and
wg> # prepared statements (default: true).
wg> #
wg> org.exolab.castor.persist.useProxies=true
Please note that this feature is available in CVS only until 0.9.7 has been
released.
wg> This property will cause Castor to use proxy objects for
wg> PreparedStatements which will output a large amount of debug output
wg> including the actual SQL statements being generated by Castor. Of
wg> course, you'll also need to enable Log4J debug level logging for the
wg> This feature is only available in Castor 0.9.6.
wg>
wg> Bruce
wg> --
wg> perl -e 'print
wg> unpack("u30","D0G)[EMAIL PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
wg> );'
wg>
wg> The Castor Project
wg> http://www.castor.org/
wg>
wg> Apache Geronimo
wg> http://geronimo.apache.org/
wg>