title: Calling stored procedure using hibernate
body: <p>I have a stored procedure defined in a package. The procedure accepts two parameters, one is a cursor:</p>
  
  <pre><code>create or replace PACKAGE TESTPACKAGE IS
  TYPE STATUSCURSOR IS REF CURSOR;
  PROCEDURE TestProcedure(cId IN VARCHAR2,
  StatusCursonVal IN OUT STATUSCURSOR);
  END;
  </code></pre>
  
  <p><strong>I am calling the procedure like this:</strong></p>
  
  <pre><code>String sql = "EXEC TESTPACKAGE.TestProcedure('testId')";
  Query query = session.createSQLQuery(sql);
          List list = query.list();
  </code></pre>
  
  <p><strong>It is returning the following error:</strong></p>
  
  <p>13:03:25,338 INFO  [stdout] (default task-3) Hibernate: EXEC TESTPACKAGE .TestProcedure('testId')</p>
  
  <p>13:03:25,749 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-3) SQL Error: 900, SQLState: 42000
  13:03:25,750 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-3) ORA-00900: invalid SQL statement</p>
  
  <p>And the exception states "Could not extract resultSet".</p>
  
  <p>I have tried to execute the procedure in SQL Developer but it failed. It seems the problem is I am executing the procedure with only one parameter but it also has an IN OUT parameter. </p>
  
  <p><strong>Please help how can I invoke this procedure.</strong></p>
  
  <p>Regards,
  Anirban.</p>