문제

I have this method to call a stored function from ORACLE, in java (spring) - using entity manager + createNativeQuery ..

(...)
String set_professional = "{? = call
    pk_backoffice.set_professional(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?}";
//32 parameters IN

query = entity.createNativeQuery(set_professional);
(...)

And everytime I try to test it, it shows: Positional parameter does not exist: 31 in query: {? = call (...) But do I have something at position 31..it exists..

query.setParameter(31, prof.getFax()); // fax

Also, I started the parameters at 1 cause in previous exceptions it said it was 1-based I've tried with a string and a null value instead of the get, still the same outcome.. About the query, I also counted the ? many times, so I'm sure it has 32 (for parameters) + 1(return - first ?)...

Can anyone help?

도움이 되었습니까?

해결책

Found a solution, I replaced all ? for variables, even the first one, and the error disappeared.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top