• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error using Spring to call Oracle stored procedure

 
J Miller
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We're using the spring framework to call an Oracle stored procedure, and it's giving me an error saying "wrong number or types of arguments in call". Here's what my dao looks like:




The spec for my stored procedure is:



So my stored proc has 1 input, and 1 output parameters. I'm only passing in a single input parameter, so I'm not sure why I'm getting that error. Any ideas?
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need to declare all parameters, IN,INOUT or OUT

WP
 
J Miller
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've updated the CriteriaStoredProcedure method to include the in parameter, and it doesn't seem to have made a difference. Still getting the same error. The only thing I can think of is that the datatype of the input param in Oracle is VARCHAR2, but there's no type for that under oracle.jdbc.OracleTypes.


 
J Miller
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found the problem. In my retrieveCriteria method, I had the name of the output cursor wrong. In Oracle it's "out_cursor", in that method I named it "output_cursor". Simple mistake.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic