title: Datatype mismatch when calling stored function
body: <p>There is an Oracle stored function :</p>
  
  <pre><code>create or replace function create_role(p_role varchar2)
  return pls_integer
  is
      v_role role.role_db%type;
  begin
      v_role := regexp_replace(p_role, '[[:space:]]*',''); /* suppression des espaces entre les caractères */
      v_role := lower(v_role);
      execute immediate 'create role ' || v_role ;
      return 1;
  exception
      when others then /* role or user of same name already exists */
          return 0;
  end;
  </code></pre>
  
  <p>I want to call it from Spring :</p>
  
  <pre><code>@Override
      @Transactional
      public Integer insert(Role role) {
  
          String roleDb = role.getLib().startsWith("role_sse_") ? StringUtils.stripAccents(role.getLib()).toLowerCase() : StringUtils.stripAccents("role_sse_"+role.getLib()).toLowerCase();
  
          simpleJdbcCall = new SimpleJdbcCall(dataSource)
                           .withFunctionName("create_role");
  
          SqlParameterSource in = new MapSqlParameterSource().addValue("p_role", roleDb);
  
          Integer ret = simpleJdbcCall.executeFunction(Integer.class, in);
  
          if (ret == 1) {
  
              Session sessionDynamic = Utils.createDynamicSession(env);
  
              role.setDb(roleDb);
  
              sessionDynamic.persist(role);
              sessionDynamic.flush();
              sessionDynamic.close();
  
          }
  
          return ret;
  
      }
  </code></pre>
  
  <p>At runtime I got error : <code>java.sql.SQLException: Invalid column type: 1111</code></p>
  
  <p>So what is wrong ?</p>