ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Неверов Дмитрий <neverov...@nkmk.ru>
Subject The error occurred while applying a parameter map
Date Mon, 17 Oct 2005 02:05:34 GMT
Hi,

   I have statement:

  <statement id="getSAObj" parameterClass="java.util.HashMap" resultClass="saAnalizRaw">
    <![CDATA[
    select t11.nplv_old as nplv, 
           nvl(t21.sname, ' ') as marka, 
           t41.conc as conc1, 
           t42.conc as conc2, 
           to_number(t41.conc, '99.9999')-to_number(t42.conc, '99.9999') as razn,
           i.id as interval,
           i.conc_ot as concOt, 
           i.conc_do as concDo
    from him_head t11, sp_name_nsi t21, him_dev t31, him_an t41, him_head t12, him_an t42,
him_dev t32, sp_name_nsi t22, sp_interval i
    where t11.id_mark = t21.id(+)
    and t31.id_head = t11.id_head
    and t31.dt_dev between to_date(#dataN:VARCHAR#, 'dd.mm.yyyy hh24:mi') and to_date(#dataK#,
'dd.mm.yyyy hh24:mi') 
    and t31.id_dev = 78
    and t41.id_analiz = t31.id_analiz
    and t41.id_elem = 21 /*elementId:NUMERIC*/ 
    and t11.id_prob = 17 /*probaId1:NUMERIC*/ 

    and t12.id_mark = t22.id(+)
    and t32.id_head = t12.id_head
    and t32.dt_dev between to_date(#dataN:VARCHAR#, 'dd.mm.yyyy hh24:mi') and to_date(#dataK#,
'dd.mm.yyyy hh24:mi') 
    and t32.id_dev = 78
    and t42.id_analiz = t32.id_analiz
    and t42.id_elem = 21 /*elementId:NUMERIC*/ 
    and t12.id_prob = 18 /*probaId2:NUMERIC*/ 
    
    and t11.nplv_old = t12.nplv_old    

    and to_number(t41.conc, '99.9999') > to_number(i.conc_ot, '99.9999')
    and to_number(t41.conc, '99.9999') <= to_number(i.conc_do, '99.9999')

    ]]>
  </statement>   

  And in jsp I do:

  HashMap h = new HashMap();

  h.put("dataN", dataN+" 00:00");
  h.put("dataK", dataK+" 23:59");
  h.put("elementId", new Integer(elementId));
  h.put("probaId1", new Integer(probaId1));
  h.put("probaId2", new Integer(probaId2));

  And I get following error:
  
com.ibatis.dao.client.DaoException:
Failed to queryForList - id [sa.getSAObj],
parameterObject [{probaId1=17, dataN=01.10.2005 00:00, elementId=21, probaId2=18, dataK=17.10.2005
23:59}].
Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in nkmk/ibatis/persistence/sqlmapdao/sql/SA.xml.
--- The error occurred while applying a parameter map.
--- Check the sa.getSAObj-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: java.sql.SQLException: ORA-01722: invalid numberCaused by:java.sql.SQLException:
ORA-01722: invalid numberCaused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in nkmk/ibatis/persistence/sqlmapdao/sql/SA.xml.
--- The error occurred while applying a parameter map.
--- Check the sa.getSAObj-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: java.sql.SQLException: ORA-01722: invalid numberCaused by: java.sql.SQLException:
ORA-01722: invalid number
at com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(SqlMapDaoTemplate.java:205)
at nkmk.ibatis.persistence.sqlmapdao.SaObjSqlMapDao.getSA(SaObjSqlMapDao.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:72)
at $Proxy176.getSA(Unknown Source)
at nkmk.ibatis.service.SAService.getSA(SAService.java:39)
at _SaAnaliz._jsp
Service(SaAnaliz.jsp:69)
[SRC:/consts.jsp:5]--

Why? All parameters are right.

And if I change statement and comment second entry of dataN parameter:

  <statement id="getSAObj" parameterClass="java.util.HashMap" resultClass="saAnalizRaw">
    <![CDATA[
    select t11.nplv_old as nplv, 
           nvl(t21.sname, ' ') as marka, 
           t41.conc as conc1, 
           t42.conc as conc2, 
           to_number(t41.conc, '99.9999')-to_number(t42.conc, '99.9999') as razn,
           i.id as interval,
           i.conc_ot as concOt, 
           i.conc_do as concDo
    from him_head t11, sp_name_nsi t21, him_dev t31, him_an t41, him_head t12, him_an t42,
him_dev t32, sp_name_nsi t22, sp_interval i
    where t11.id_mark = t21.id(+)
    and t31.id_head = t11.id_head
    and t31.dt_dev between to_date(#dataN:VARCHAR#, 'dd.mm.yyyy hh24:mi') and to_date(#dataK#,
'dd.mm.yyyy hh24:mi') 
    and t31.id_dev = 78
    and t41.id_analiz = t31.id_analiz
    and t41.id_elem = 21 /*elementId:NUMERIC*/ 
    and t11.id_prob = 17 /*probaId1:NUMERIC*/ 

    and t12.id_mark = t22.id(+)
    and t32.id_head = t12.id_head
    and t32.dt_dev between to_date(/*dataN:VARCHAR*/'01.10.2005 00:00', 'dd.mm.yyyy hh24:mi')
and to_date(#dataK#, 'dd.mm.yyyy hh24:mi') 
    and t32.id_dev = 78
    and t42.id_analiz = t32.id_analiz
    and t42.id_elem = 21 /*elementId:NUMERIC*/ 
    and t12.id_prob = 18 /*probaId2:NUMERIC*/ 
    
    and t11.nplv_old = t12.nplv_old    

    and to_number(t41.conc, '99.9999') > to_number(i.conc_ot, '99.9999')
    and to_number(t41.conc, '99.9999') <= to_number(i.conc_do, '99.9999')

    ]]>
  </statement>

All works normally.

Any suggestions?

Thanks for help.
mailto:neverov_dg@nkmk.ru





Mime
View raw message