Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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.
Previous Topic:Secondary table with join on constant value
Next Topic:Parsing error in JPQL query
Goto Forum:
  


Current Time: Mon Jul 07 01:26:23 EDT 2025

Powered by FUDForum. Page generated in 0.04394 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top