ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Balmer <bbal...@peapod.com>
Subject Re: SQL Map Problem - iterating through a list, using a like query
Date Tue, 06 Mar 2007 22:20:20 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Could it be that you are missing the &lt;dynamic&gt; tag wrapped around
the &lt;isNotEmpty&gt; ?<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:ayan.m.afridi@jpmchase.com">ayan.m.afridi@jpmchase.com</a>
wrote:
<blockquote
 cite="midOF56D422E1.37C6C729-ON85257296.0072B67B-85257296.00741BB1@jpmchase.com"
 type="cite"><br>
  <font face="sans-serif" size="2">Hi,</font>
  <br>
  <font face="sans-serif" size="2">I am trying to do a select from a
table,
using dynamic sql like so:</font>
  <br>
  <br>
  <font face="Courier New" size="2">SELECT *</font>
  <br>
  <font face="Courier New" size="2">FROM TABLE_NAME</font>
  <br>
  <font face="Courier New" size="2">WHERE STATUS = 'A'</font>
  <br>
  <font color="#008080" face="Courier New" size="2">&lt;</font><font
 color="#3f8080" face="Courier New" size="2">isNotEmpty
  </font><font color="#800080" face="Courier New" size="2">prepend</font><font
 face="Courier New" size="2">=</font><font color="#4200ff"
 face="Courier New" size="2">"AND"
  </font><font color="#800080" face="Courier New" size="2">property</font><font
 face="Courier New" size="2">=</font><font color="#4200ff"
 face="Courier New" size="2">"accountList"</font><font color="#008080"
 face="Courier New" size="2">&gt;</font>
  <br>
  <font face="Courier New" size="2">&nbsp; &nbsp; &nbsp; &nbsp; </font><font
 color="#008080" face="Courier New" size="2">&lt;</font><font
 color="#3f8080" face="Courier New" size="2">iterate
  </font><font color="#800080" face="Courier New" size="2">open</font><font
 face="Courier New" size="2">=</font><font color="#4200ff"
 face="Courier New" size="2">"("
  </font><font color="#800080" face="Courier New" size="2">close</font><font
 face="Courier New" size="2">=</font><font color="#4200ff"
 face="Courier New" size="2">")"
  </font><font color="#800080" face="Courier New" size="2">conjunction</font><font
 face="Courier New" size="2">=</font><font color="#4200ff"
 face="Courier New" size="2">"OR"
  </font><font color="#800080" face="Courier New" size="2">property</font><font
 face="Courier New" size="2">=</font><font color="#4200ff"
 face="Courier New" size="2">"accountList"</font><font color="#008080"
 face="Courier New" size="2">&gt;</font>
  <br>
  <font face="Courier New" size="2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; UPPER(ACC_SHRT_NM) like UPPER('%$accountList[]$%')</font>
  <br>
  <font face="Courier New" size="2">&nbsp; &nbsp; &nbsp; &nbsp; </font><font
 color="#008080" face="Courier New" size="2">&lt;/</font><font
 color="#3f8080" face="Courier New" size="2">iterate</font><font
 color="#008080" face="Courier New" size="2">&gt;</font>
  <br>
  <font color="#008080" face="Courier New" size="2">&lt;/</font><font
 color="#3f8080" face="Courier New" size="2">isNotEmpty</font><font
 color="#008080" face="Courier New" size="2">&gt;</font>
  <br>
  <font face="sans-serif" size="2">Basically I want this query to
create
a bunch of "like" clauses using the elements of the List accountList.
  </font><br>
  <font face="sans-serif" size="2">For some reason this is not working
- I get nothing returned. </font>
  <br>
  <br>
  <font face="sans-serif" size="2">Is this syntax correct?</font>
  <br>
  <br>
  <font face="sans-serif" size="2">-Ayan</font>
  <br>
  <hr size="1"><br>
  <p><br>
This transmission may contain information that is privileged,<br>
confidential, legally privileged, and/or exempt from disclosure<br>
under applicable law. If you are not the intended recipient, you<br>
are hereby notified that any disclosure, copying, distribution, or<br>
use of the information contained herein (including any reliance<br>
thereon) is STRICTLY PROHIBITED. Although this transmission and<br>
any attachments are believed to be free of any virus or other<br>
defect that might affect any computer system into which it is<br>
received and opened, it is the responsibility of the recipient to<br>
ensure that it is virus free and no responsibility is accepted by<br>
JPMorgan Chase &amp; Co., its subsidiaries and affiliates, as<br>
applicable, for any loss or damage arising in any way from its use.<br>
If you received this transmission in error, please immediately<br>
contact the sender and destroy the material in its entirety,<br>
whether in electronic or hard copy format. Thank you.<br>
  </p>
</blockquote>
</body>
</html>


Mime
View raw message