Found a solution, I replaced all ? for variables, even the first one, and the error disappeared.
#Resolved - Positional parameter does not exist in query // stored function call
-
09-07-2023 - |
Question
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?
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow