Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. create or replace PROCEDURE MY_STORED_PROC(customerName IN VARCHAR2, customerAge IN number)
  2. AS
  3. BEGIN
  4. --Some code that does not return anything here
  5. END MY_STORED_PROC;
  6.  
  7. Session session = entityManager.getEntityManagerFactory().createEntityManager().unwrap(Session.class);
  8. StoredProcedureQuery myProc= session.createStoredProcedureQuery(
  9. QueryConstants.MY_STORED_PROC);
  10. myProc.registerStoredProcedureParameter("customerName", String.class, ParameterMode.IN);
  11. myProc.registerStoredProcedureParameter("customerAge", Integer.class, ParameterMode.IN);
  12. myProc.setParameter("customerName", "Terwilliger");
  13. myProc.setParameter("customerAge", 23);
  14. myProc.execute();
  15.  
  16. javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults
  17.  
  18. Caused by: org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults
  19.  
  20. Caused by: java.sql.SQLException: The number of parameter names does not match the number of registered praremeters
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement