Bruce Snyder writes:

> Emir,
> 
> Actually I've never attempted to use these two functions via Castor.
> If you're so inclined, please implement the testSelectWithFunctions()
> method within src/tests/jdo/OqlTests.java and post the diff in
> Bugzilla as an enhancement. 

i'd like to, but i simply don't have any example of a proper use
of first() and last(), beside the syntax definition.
i've tried some simple queries (SELECT first(p.id) FROM Person
p), but i got an exception claiming:

<<<>> Persistence exception occurred: java.sql.SQLException:
ORA-00904: "FIRST": invalid identifier

if i try 'first(p)' than i got exception from parser that
aggregate functions requires primitive type. first() and last()
are not quite like other sql aggregate functions as far as i
understand....

it seems that these do not translate properly or i'm doing
something completely different than what's expected. :-)

on the other hand if we look into oql castor documentation:

Certain features of OQL may not be directly translatable to SQL,
but may still be supported, by post processing the query. For
example, the first() and last() collection functions supported
in OQL are not directly translatable to standard SQL, but a
resultset can be post-processed to return the appropriate
values. 

if the first() is a result of a post-processing how come the
FIRST is simply passed to Oracle engine?!?!

i'll do some tests with queryanalyzer and let you know what i
got.
if i found out that this is definitely bug or not implemented,
i'll submit it and hopefully do something about it. :-)

regards,
emir

__/-o |
________________________________
15 Mbytes Free Web-based and  POP3
Sign up now: http://www.gawab.com

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to