Another Problem with DB2 v.5 for MVS/OS-390

From: André Luiz do Nascimento Sousa (andresous..aixaseguros.com.br)
Date: Thu Sep 23 2004 - 17:45:37 EDT

  • Next message: Andrus Adamchik: "Re: Problem with RTRIM() Function in DB2 v.5 for MVS/OS-390"

    Hello, Cayenne Users,
              I'm having problems with the correct format of date fields in queries.

              I'm using the "org.objectstyle.cayenne.dba.db2.DB2Adapter". Is there another way to format the date?

              See the code:
      wDtCtx = DataContext.createDataContext();
      if (wForm.getDthExtracao() != null && wForm.getDthExtracao().length() > 0) {
          wSQL += " and dthExtracao >= $pDTH_EXTRACAO ";
          wHashParams.put("pDTH_EXTRACAO", DateManager.obtemData(wForm.getDthExtracao(), "dd/MM/yyyy"));
      }
      wExpr = Expression.fromString(wSQL).expWithParameters(wHashParams);
      wQuery = new SelectQuery(Extracao.class, wExpr);
      wForm.setVecResultadoPesquisa(wDtCtx.performQuery(wQuery));

    INFO RequestProcessor: Processing a 'POST' for path '/TestarCayenne'
    INFO QueryLogger: --- will run 1 query.
    INFO QueryLogger: SELECT t0.COD_BOL_SIMUL, t0.DES_NUMERO_SORT, t0.DTH_EXTRACAO, t0.NOM_LOCAL_EXTRACAO, t0.NUM_EXTRACAO, t0.NUM_INICIAL_DOC, t0.SIGLA_UF, t0.IDE_REGRA_EXTRACAO FROM FDRCAP.FC_EXTRACAO t0 WHERE (? = ?) AND (t0.DTH_EXTRACAO >= ?) [bind: 1, 1, '2004-05-01 00:00:00.0']
    INFO QueryLogger: *** error.
    COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2] SQL0417N Uma cadeia de instrução a ser preparada contém marcadores de parâmetros como operandos do mesmo operador. SQLSTATE=42609
    at java.lang.Throwable.<init>(Throwable.java:59)
    at java.lang.Throwable.<init>(Throwable.java:73)
    at java.sql.SQLException.<init>(SQLException.java:52)
    at COM.ibm.db2.jdbc.DB2Exception.<init>(DB2Exception.java:72)

              Thanks a lot.

      André Luiz do Nascimento Sousa
          Analista de Sistemas - J2EE
              Brasil <) ><



    This archive was generated by hypermail 2.0.0 : Thu Sep 23 2004 - 17:44:11 EDT