I'm having problems trying to call an Oracle 10g stored function that returns a result set (via sys_refcursor) from the NamedNativeQuery annotation.
I get this error:
Caused by: java.sql.SQLException: ORA-00900: invalid SQL statement
Here's the annotation:
@NamedNativeQuery(name = "MyQuery", callable = true,
query = "{? = call MYSCHEMA.MY_FUNCTION(:purgeDate)}",
readOnly = true, resultClass = QueryResultDTO.class)
Here's the logging:
DEBUG org.hibernate.SQL -
/* named native SQL query MyQuery*/ {? = call MYSCHEMA.MY_FUNCTION(?)}
33281 [http-8080-2] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 900, SQLState: 42000
33281 [http-8080-2] ERROR org.hibernate.util.JDBCExceptionReporter - ORA-00900: invalid SQL statement
What's the problem?
|