[ http://issues.apache.org/jira/browse/IBATIS-148?page=comments#action_12313104 ]
Sam Abeyratne commented on IBATIS-148: -------------------------------------- Hi Brandon, Thank you for getting this done so quickly. I tested this out, but I am still not seeing the expected results. Although I am not seeing the exceptions above, I do not see the correct results either. In the same example above, if I run th query manually I see the correct results. But if I run it through ibatis, I get zero results. I think there might be an issue with the translation of #carrier# (in this case) that is within the dynamic sql. I think somehow, it is not getting set correctly and the DB query results in 0 records. Is there something that I might be doing incorrectly? Thanks again for your awesome support! Sam 2005-06-08 15:12:58,056 [HttpRequestHandler-243] DEBUG java.sql.PreparedStatement - {pstm-100040} Parameters: [ABCDE1, DSP, ABCDE1, DSP] 2005-06-08 15:12:58,056 [HttpRequestHandler-243] DEBUG java.sql.PreparedStatement - {pstm-100040} Types: [java.lang.String, java.lang.String, java.lang.String, java.lang.String] 2005-06-08 15:12:58,457 [HttpRequestHandler-243] DEBUG java.sql.ResultSet - {rset-100041} ResultSet 2005-06-08 15:12:58,457 [HttpRequestHandler-243] DEBUG mimtools.common.BaseDAO.class - Multiple Query successful. Result list length: 0 > Capability to use dynamic sql within iterates > --------------------------------------------- > > Key: IBATIS-148 > URL: http://issues.apache.org/jira/browse/IBATIS-148 > Project: iBatis for Java > Type: Improvement > Components: SQL Maps > Versions: 2.0.9b, 2.1.0 > Reporter: Sam Abeyratne > Assignee: Brandon Goodin > > I am getting the following error when I try to run a simple query that has a > dynamic <isNotEqual> within an iterate tag. Per Brandon, this is a known > issue that needs to be fixed. > Thanks! > Sam > 2005-06-06 17:11:25,284 [HttpRequestHandler-2083] DEBUG xxxDAO.class - > Parameters: {sidList=[abc1, abc2], carrier=ABCDE1, interfaceType=DSP} > 2005-06-06 17:11:25,284 [HttpRequestHandler-2083] DEBUG xxxDAO.class - > Calling queryForList with statementName: queryInterfaceErrorCount and > parameters: {sidList=[abc1, abc2], carrier= ABCDE1, interfaceType=DSP} > 2005-06-06 17:11:25,294 [HttpRequestHandler-2083] ERROR > xxxDispatchAction.class - Entered catch block in viewErrorLog: Exception in > queryInterfaceErrorCount: 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: "" > The sqlmap looks something like: > <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 [EMAIL PROTECTED] > where interface_type = #interfaceType# > <isNotEqual prepend="and" property="carrier" compareValue="All"> > carrier_name = #carrier# > </isNotEqual> > </iterate> > ) > </select> > > Java bean looks like: > public class InterfaceErrorCount { > private int count; > public int getCount() { > return count; > } > public void setCount(int count) { > this.count = count; > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira