How can i convert varchar to number in JPQL ???
I managed to do that in sql (Oracle) with this query:
SELECT Decode(Upper(column_name), Lower(column_name), To_Number(column_name), -1)
FROM table
I want to do this conversion with JPQL.
Thanks for your help
You can do the next:
CAST(e.salary AS NUMERIC(10,2))
Additionally, you can try:
FUNC('TO_NUMBER', e.areaCode)
, FUNC
allows for a database function to be call from JPQL.
SQL('CAST(? AS CHAR(3))', e.areaCode)
, SQL
allows for the usage and integration of SQL within JPQL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With