Link to home
Start Free TrialLog in
Avatar of alnasl
alnasl

asked on

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

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
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

You have three bind variables in the statement but you only set two
ASKER CERTIFIED SOLUTION
Avatar of alnasl
alnasl

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
OK