Call a PL/SQL precedent by passing a date as parameter

Asked

Viewed 50 times

0

I have a PL/SQL design

( LnCDOrigem            IN Company.COD_CD%TYPE,
   LnSotoreOrigem       IN Company.COD_STORE%TYPE,
   LvTipoEqpt           IN VARCHAR2,
   LdDtMovimento        IN DATE,
   LnRetorno            OUT NUMBER)

When I make her call through Java I get a following error

ORA-01858: a non-numeric character was found where a numeric was expected
ORA-06512: at line 1

My java code is like this

CallableStatement statement = getConnection().prepareCall(
            "{ Call PCK_ABERTURA_CONTABIL.Abrir_Data_Contabil(:LnCDOrigem, :LnSotoreOrigem, " +
                    ":tipoEquipamento, :dataMovimento, :retorno) }");
    Date dataMovimento = Date.valueOf(dataHora);
    statement.setLong("LnCDOrigem", codigoOrigem);
    statement.setLong("LnStoreOrigem", codigoStore);
    statement.setDate("dataMovimento", dataMovimento);
    statement.setString("tipoEquipamento", "M");
    statement.registerOutParameter("retorno", OracleTypes.NUMBER);
    statement.execute();
    return statement.getLong("retorno");
  • So you can not know very well what it is, the only information we have is that in one of the fields he is waiting a number and receiving a "not number", tries to enable the log to show the generated sql, I believe it will facilitate identify the problem

  • Discover that even passing the parameters with key and value, only worked when I put them in the order of the PL/SQL call.]

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.