ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abeyratne, Sam" <sam.abeyra...@cingular.com>
Subject dynamic SQL within an iterate
Date Tue, 31 May 2005 18:39:20 GMT
I want to use dynamic SQL within an iterate. However, the dynamic sql
refers to a non-iterate property variable. Is this possible? I am
getting this error at the moment:

 

com.ibatis.common.beans.ProbeException: Error getting ordinal list from
JavaBean. Cause java.lang.NumberFormatException: For input string: ""

Caused by: java.lang.NumberFormatException: For input string: ""

 

 

Query:

 

<select id="queryInterfaceErrorCount" parameterClass="java.util.Map"
resultMap="interface_error_count_result"
cacheModel="interface_error_count_cache">

    select sum(count) as count

    from 

    ( 

      <iterate property="sidList" open="(" close=")" conjunction="UNION
ALL">

        select count(*) as count

          from mim_error_log@$sidList[]$

        where interface_type = #interfaceType# 

        <isNotEqual prepend="and" property="carrier" compareValue="All">


          carrier_name = #carrier#  

        </isNotEqual>

      </iterate>

    )

  </select>

 

Thanks!

Sam

 


Mime
View raw message