How to call stored procedure by hibernate?
- by user367097
Hi I have an oracle stored procedure
GET_VENDOR_STATUS_COUNT(DOCUMENT_ID IN NUMBER , NOT_INVITED OUT NUMBER,INVITE_WITHDRAWN OUT NUMBER,...
rest all parameters are OUT parameters.
In hbm file I have written -
<sql-query name="getVendorStatus" callable="true">
<return-scalar column="NOT_INVITED" type="string"/>
<return-scalar column="INVITE_WITHDRAWN" type="string"/>
<return-scalar column="INVITED" type="string"/>
<return-scalar column="DISQUALIFIED" type="string"/>
<return-scalar column="RESPONSE_AWAITED" type="string"/>
<return-scalar column="RESPONSE_IN_PROGRESS" type="string"/>
<return-scalar column="RESPONSE_RECEIVED" type="string"/>
{ call GET_VENDOR_STATUS_COUNT(:DOCUMENT_ID , :NOT_INVITED ,:INVITE_WITHDRAWN ,:INVITED ,:DISQUALIFIED ,:RESPONSE_AWAITED ,:RESPONSE_IN_PROGRESS ,:RESPONSE_RECEIVED ) }
</sql-query>
In java I have written -
session.getNamedQuery("getVendorStatus").setParameter("DOCUMENT_ID", "DOCUMENT_ID").setParameter("NOT_INVITED", "NOT_INVITED")
... continue till all the parametes .
I am getting the sql exception
18:29:33,056 WARN [JDBCExceptionReporter] SQL Error: 1006, SQLState: 72000
18:29:33,056 ERROR [JDBCExceptionReporter] ORA-01006: bind variable does not exist
Please let me know what is the exact process of calling a stored procedure from hibernate. I do not want to use JDBC callable statement.