I'm trying to call an Oracle function from Java, and I get the following error message:
java.sql.SQLException: ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'test'
ORA-06550: line 1, column 13:
PLS-00306: wrong number or types of arguments in call to 'test'
ORA-06550: line 1, column 7:
PL / SQL: Statement ignored
This is the way I'm invoking the function:
String ejecucion = "{ ?=call prueba(?,?,?,?,?,?,?,?,?) }";
CallableStatement cons = c.ejecutarProcedimiento(ejecucion, 0); // Aquí invoco al método "precall"
double monto = 0;
cons.registerOutParameter(1, java.sql.Types.FLOAT);
// Parametro del procedimiento almacenado
cons.setFloat(2, 2);
cons.setDouble(3, importe);
cons.setDate(4,TareasGenerales.convertirFecha(Parametros.cabezal.getFechaVencimientoPresentacion()));
cons.setDate(5,TareasGenerales.convertirFecha(Parametros.cabezal.getFechaVencmientoPago()));
cons.setDate(6, TareasGenerales.convertirFecha(Parametros.fechaActual));
cons.setDate(7, TareasGenerales.convertirFecha(Parametros.fechaActual));
cons.setBoolean(8, false);
cons.setInt(9, Integer.valueOf(Parametros.cabezal.getAnioMesDesde()));
cons.setBoolean(10, false);
cons.executeQuery();
This is the way in which the function is implemented:
declare
-- Boolean parameters are translated from/to integers:
-- 0/1/null <--> false/true/null
pa_a boolean := sys.diutil.int_to_bool(:a);
pa_b boolean := sys.diutil.int_to_bool(:b);
begin
-- Call the function
:result := prueba(c=> :c,
d => :d,
e => :e,
f => :f,
g => :g,
h => :g,
i => i,
j => :j,
k => k);
end;
FUNCTION Prueba(tipo_calc IN NUMBER,
impte IN NUMBER,
f_venc IN DATE,
f_venc_p DATE,
f_pre IN DATE,
f_pa IN DATE,
pa_tiene IN BOOLEAN,
pa_anio IN NUMBER,
pa_buen IN BOOLEAN) RETURN NUMBER;
Do you know what the source of the error may be?