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,409 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSum6 challenge 6 76
split53 challenge 7 77
nextBoolean(double p) for Random class 3 35
'G_F01' is not a procedure or is undefined 3 12
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
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 …

914 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

16 Experts available now in Live!

Get 1:1 Help Now