Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.05
Mapping documents:
Code:
<sql-query name="KF_SYN_GET_NOME" callable="true">
<return-scalar column="name" type="string"/>
{? = call KF_SYN_GET_NOME(?)}
</sql-query>
Code between sessionFactory.openSession() and session.close():1st solution:
Code:
Query q = session.getNamedQuery("KF_SYN_GET_NOME");
q.setString(0, uid);
Object o = q.uniqueResult();
doesn't work with this stacktrace:
Hibernate: {? = call KF_SYN_GET_NOME(?)}
[WARN] JDBCExceptionReporter - SQL Error: 6550, SQLState: 65000
[ERROR] JDBCExceptionReporter - ORA-06550: line 1, column 13:
PLS-00382: expression is of wrong type
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
2nd solution with same sp:
Code:
call = session.connection().prepareCall(procedure);
call.registerOutParameter(1, Types.VARCHAR);
call.setString(2, uid);
call.execute();
It does work perfectly.
SP code:
Code:
CREATE OR REPLACE
Function KF_SYN_GET_NOME(p_user IN VARCHAR2) RETURN VARCHAR2 IS
BEGIN
RETURN SYURP11.PKG_API.GETINFOWS(p_user, 0, 'nome');
END;
/
Why??