i'm trying to call several stored functions from my java app, but whatever function i call i got the same error. For example, given this function:
function insert_value (input_name varchar2) return number;
I'm trying to call it using:
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
SimpleJdbcCall call= new SimpleJdbcCall(jdbcTemplate)
.withCatalogName("MY_PACKAGE_NAME")
.withFunctionName("insert_value")
.withoutProcedureColumnMetaDataAccess()
.declareParameters(
new SqlParameter("input_name", Types.VARCHAR));
SqlParameterSource parameterMap = new MapSqlParameterSource()
.addValue("input_name", "John Doe");
int idNumber = call.executeFunction(Integer.class,parameterMap);
I always get the same error:
java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'INSERT_VALUE'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
As you can see the name of the parameter is correct, i've already checked that my jdbc driver supports Named Parameters and i do not how i can pass indexes instead of parameters names on SimpleJdbcCall.
Any advise? Keep in mind that i have few more complex functions which i invoke in the same way which return the same error.