• 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

Another "wrong number or types of arguments in call..." Question

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings. I am making the big switch from a PowerBuilder Environment to a Java shop. My first task is to build a Java program that calls an Oracle function. Any help would be great.
The Java code:



The Function code is:
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have 3 question marks in the statement, but only 2 parameters. So...
 
Rick Martin
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:You have 3 question marks in the statement, but only 2 parameters. So...



So, do I need to define the third parm with the user ip address as requested in the function?
Such as
 
Rick Martin
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I tried this and the error changed to "invalid column index"



I also tried to just remove one of the '?' from the function call. Same "invalid column index" error message was returned. I am stumped. I feel that I am missing something very obvious, but I have no idea what it may be.

 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You had three question marks, two input parameters and one output parameter (all properly registered), so that would look about right. Adding another one is certainly not going to help.

You've posted a wrong stored procedure - GET_CONTACT_REQUEST_BY_SSN, but your code calls GET_CONTACT. Posting the right one might give us a better clue. I guess (just guess) that the third parameter is an IN OUT one, not just OUT one. It might mean that you need to set the third parameter and register it as an output one at the same time.
 
Rick Martin
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Martin Vajsar wrote:You had three question marks, two input parameters and one output parameter (all properly registered), so that would look about right. Adding another one is certainly not going to help.

You've posted a wrong stored procedure - GET_CONTACT_REQUEST_BY_SSN, but your code calls GET_CONTACT. Posting the right one might give us a better clue. I guess (just guess) that the third parameter is an IN OUT one, not just OUT one. It might mean that you need to set the third parameter and register it as an output one at the same time.



OK, that makes sense. Thank you. The stored procedure is what the DBA gave me to call. I will try the changes that you are suggesting. This site have amazingly fast responses to programming questions. I have been on sites that it may take days or weeks before someone will reply. I think I have found a coding message board that I can stick around with. Thanks again for the responses.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic