Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Rick Martin
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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:
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65339
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.

 
Martin Vajsar
Sheriff
Posts: 3752
62
Chrome Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic