title: How to call a stored procedure in Hibernate?
body: <p>I have a stored procedure in Oracle database.</p>
  
  <pre><code>GET_VENDOR_STATUS_COUNT(DOCUMENT_ID IN NUMBER, NOT_INVITED OUT NUMBER, INVITE_WITHDRAWN OUT NUMBER, ...
  </code></pre>
  
  <p>Other parameters are OUT parameters.</p>
  
  <p>In my <em>hbm</em> file I have written the following:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;sql-query name="getVendorStatus" callable="true"&gt;
       &lt;return-scalar column="NOT_INVITED" type="string"/&gt;
       &lt;return-scalar column="INVITE_WITHDRAWN" type="string"/&gt;
       &lt;return-scalar column="INVITED" type="string"/&gt;
       &lt;return-scalar column="DISQUALIFIED" type="string"/&gt;
       &lt;return-scalar column="RESPONSE_AWAITED" type="string"/&gt;
       &lt;return-scalar column="RESPONSE_IN_PROGRESS" type="string"/&gt;
       &lt;return-scalar column="RESPONSE_RECEIVED" type="string"/&gt;
       { call GET_VENDOR_STATUS_COUNT(:DOCUMENT_ID , :NOT_INVITED ,:INVITE_WITHDRAWN ,:INVITED ,:DISQUALIFIED ,:RESPONSE_AWAITED ,:RESPONSE_IN_PROGRESS ,:RESPONSE_RECEIVED ) }
  &lt;/sql-query&gt;
  </code></pre>
  
  <p>And here is my Java code:</p>
  
  <pre><code> session.getNamedQuery("getVendorStatus").setParameter("DOCUMENT_ID", "DOCUMENT_ID").setParameter("NOT_INVITED", "NOT_INVITED") 
  </code></pre>
  
  <p>... continue till all the parameters.</p>
  
  <p>I am getting the following SQL exception: </p>
  
  <blockquote>
    <p>18:29:33,056 WARN  [JDBCExceptionReporter] SQL Error: 1006, SQLState:
    72000<br>
    18:29:33,056 ERROR [JDBCExceptionReporter] ORA-01006: bind
    variable does not exist</p>
  </blockquote>
  
  <p><br>
  Please let me know what is the exact process of calling a stored procedure in Hibernate? I do not want to use JDBC callable statement. </p>