'sql state 99999 error code 17012 parameter type conflict

I use this Oracle stored procedure that works correctly in developing tools:

procedure invf_ppn_xml(p_doc_id number,
                p_file_name   out varchar2,
                p_file_body   in out nocopy blob,
                p_prikaz      number := 820)

I also use JdbcTemplate to call it:

SimpleJdbcCall call = new SimpleJdbcCall(jdbcTemplate).withoutProcedureColumnMetaDataAccess()
            .withCatalogName("my_package").withProcedureName(funcName)
            .declareParameters(
                    new SqlParameter("p_doc_id", OracleTypes.BIGINT),
                    new SqlOutParameter("p_file_name", OracleTypes.VARCHAR),
                    new SqlInOutParameter("p_file_body", OracleTypes.BLOB)/*,
                    new SqlParameter("p_prikaz", OracleTypes.BIGINT)*/);

    byte[] blob = {};
    SqlParameterSource in = new MapSqlParameterSource()
            .addValue("p_doc_id", id)
         //   .addValue("p_file_name", "")
            .addValue("p_file_body", new SqlLobValue( blob, new DefaultLobHandler()), Types.BLOB);
         //   .addValue("p_prikaz", new BigDecimal(820));

    Map<String, Object> out = call.execute(in);
    param.setFilename((String) out.get("p_file_name"));
    return (byte[]) out.get("p_file_body");

When my program calls execute it falls with the message: sql state 99999 error code 17012 parameter type conflict.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source