I have a function in PostgreSQL
that takes 6 values, the first one character varying
, the next one an integer and the remaining 4 are of type numeric
.
I call it from Java in the following way:
preStmt=con.prepareStatement("SELECT
sp_ins_act_productounidad(?,?,?,?,?,?);");
preStmt.setString(1, entPU.getProd_cod());
preStmt.setInt(2, entPU.getUni_codigo());
preStmt.setDouble(3, entPU.getPu_minimo());
preStmt.setDouble(4, entPU.getPu_maximo());
preStmt.setDouble(5, entPU.getPu_precionormal());
preStmt.setDouble(6, entPU.getPu_precioespecial());
rs=preStmt.executeQuery();
I get the following error:
there is no function sp_ins_act_productounidad (character varying, integer, double precision, double precision, double precision, double precision) Hint: No function matches the name and types of arguments. It may be necessary to add explicit conversion of types.
I tried the function from PostgreSQL
and it does not give me any problem but when calling it from Java it throws me that error, I also tried changing the data type by Float