Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create or replace PROCEDURE MY_STORED_PROC(customerName IN VARCHAR2, customerAge IN number)
- AS
- BEGIN
- --Some code that does not return anything here
- END MY_STORED_PROC;
- Session session = entityManager.getEntityManagerFactory().createEntityManager().unwrap(Session.class);
- StoredProcedureQuery myProc= session.createStoredProcedureQuery(
- QueryConstants.MY_STORED_PROC);
- myProc.registerStoredProcedureParameter("customerName", String.class, ParameterMode.IN);
- myProc.registerStoredProcedureParameter("customerAge", Integer.class, ParameterMode.IN);
- myProc.setParameter("customerName", "Terwilliger");
- myProc.setParameter("customerAge", 23);
- myProc.execute();
- javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults
- Caused by: org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults
- 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