• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error using Spring to call Oracle stored procedure

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic