Problem with RTRIM() Function in DB2 v.5 for MVS/OS-390

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

  • Next message: André Luiz do Nascimento Sousa: "Another Problem with DB2 v.5 for MVS/OS-390"

    Hello, Cayenne Users,

            I'm facing a little trouble with RTrim() function in char() types. I'm using the big shit of DB2 v.5 for MVS/OS-390 and it doesn't have this function.

            I'm using the "org.objectstyle.cayenne.dba.db2.DB2Adapter". Is there another way to avoid the use of RTRIM()?

            See the code:
      wDtCtx = DataContext.createDataContext();
      if (wForm.getSiglaUf() != null) {
        wSQL += " and siglaUf = $pUF ";
        wHashParams.put("pUF", wForm.getSiglaUf());
      }
      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 (RTRIM(t0.SIGLA_UF) = ?) [bind: 1, 1, 'DF']
    INFO QueryLogger: *** error.
    COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2] SQL0104N Um token inesperado "RTRIM" foi encontrado após "". Os tokens esperados podem incluir: "AVG, SUBSTR, MAX, HEX, FLOAT, DATE, YEAR, ETC.". SQLSTATE=42601
    at java.lang.Throwable.<init>(Throwable.java:59)
    at java.lang.Throwable.<init>(Throwable.java:73)

            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:24:23 EDT