Solved

Error: PLS-00306: wrong number or types of arguments in call to '' when executing pl/sql function from java

Posted on 2008-06-19
3
1,406 Views
Last Modified: 2013-12-18
Hi!

I have the following problem. I am calling a pl/sql function from a JavaBean. The pl/sql function works perfectly, but when I call the bean, I get the error

Error executing statement: java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'RETRIEVE_TECH_ID'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

Here's the code that causes the error:
-------------------------------------------------------------------
qryStechsIDs = "begin ? := retrieve_tech_id(?, ?); end;";
cs = con.getConnection().prepareCall(qryStechsIDs);
cs.setString(1, rs.getString("RSLT_TABLE_NAME"));
cs.setInt(2, rs.getInt("RSLT_PK"));                  
cs.registerOutParameter(3, OracleTypes.CURSOR);
------------------------------------------------------------------

The pl/sql function gets 2 parameters: VARCHAR2 and NUMBER and returns a Cursor. I suppose that the problem is in the data type of the input parameters, but I just can't sort it out. So, how can I get rid of the stupid error?

Thanks for the help in advance!

BR,
al
0
Comment
Question by:alnasl
  • 2
3 Comments
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
You have three bind variables in the statement but you only set two
0
 

Accepted Solution

by:
alnasl earned 0 total points
Comment Utility
Nope. The count is OK - 1 Ouput and 2 Inputs.

But I found it. The problem was in the sequence of the parameters. The Output parameter must be labeled with 1.

0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
OK
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now