Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Is it possible to use to_number function in JPQL(Is it possible to use to_number in JPQL)
Is it possible to use to_number function in JPQL [message #630726] Mon, 04 October 2010 13:27 Go to next message
Kiran  is currently offline Kiran
Messages: 8
Registered: October 2010
Junior Member
I have the following sql query
select * from hrwf.DEPT_DIV_UNIT_REP_NYU_T order by to_number(unit_no),to_number(div_no)

Is it possible to convert this into a named query. I could not find to_number in JPQL. Thanks for your time and help.

Regards
Kiran
Re: Is it possible to use to_number function in JPQL [message #632403 is a reply to message #630726] Tue, 12 October 2010 15:17 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

There is no TO_NUMBER function in JPQL.

In EclipseLink (2.1) you can use the FUNC keyword to call a database function.

i.e.
ORDER BY FUNC('TO_NUMBER', rep.unit_no)

You could also use EclipseLink Expressions to define the query (which support toNumber()), or use a native SQL query.


James : Wiki : Book : Blog : Twitter
Previous Topic:Secondary table with join on constant value
Next Topic:Parsing error in JPQL query
Goto Forum:
  


Current Time: Thu Jul 31 15:57:27 EDT 2014

Powered by FUDForum. Page generated in 0.02030 seconds