Hi all
i have a named query declared as follows
Code:
<sql-query name="GetCurrentSubjectId_SP" callable="true">
{? = call GetCurrentSubjectId() }
</sql-query>
GetCurrentSubjectId is a stored procedure which needs no parameters and returns only a number.
so what return class i need to specify here?
here is how I execute the named query:
Code:
Query query=session.getNamedQuery("GetCurrentSubjectId_SP");
long id=(Long)query.uniqueResult();
but i get this error. Obviously, i need to specify the return type. but how?
Code:
11:09:39,233 ERROR [http-8080-1] JDBCExceptionReporter:234 - ORA-06550: line 1, column 13:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Caused by: java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored