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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that useā€¦
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

832 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