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,413 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
ID: 21820638
You have three bind variables in the statement but you only set two
0
 

Accepted Solution

by:
alnasl earned 0 total points
ID: 21820753
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
ID: 21820835
OK
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video teaches viewers about errors in exception handling.

726 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