You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "Abeyratne, Sam" <sa...@cingular.com> on 2005/05/31 20:39:20 UTC
dynamic SQL within an iterate
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