i get an error with the following statement in a hibernate hbm file:
...
<subselect>
<![CDATA[
select t.colA, right(t.colB, 12) b
]]>
</subselect>
...
The error is Caused by: java.sql.SQLException: ORA-00904: "RIGHT": invalid Identifier
Database: Oracle 11g
Hibernate: 3.5.6-Final
On the Java side i use Hibernate Criteria to retrieve the data from the database.
Without the right function it works without error.
The statement runs without error too directly executed with an sql client on the database.
Could the Criteria API causes the problem?
Oracle doesn’t seem to support
RIGHTfunction. You can try usingSUBSTRfunction instead, something like:References:
Oracle String Functions on oradev
Oracle String Functions on techonthenet
Oracle/PLSQL String Functions
Oracle right function