Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 7073 invoked from network); 15 Feb 2007 22:13:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Feb 2007 22:13:07 -0000 Received: (qmail 95695 invoked by uid 500); 15 Feb 2007 22:13:12 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 95680 invoked by uid 500); 15 Feb 2007 22:13:12 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 95669 invoked by uid 99); 15 Feb 2007 22:13:12 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Feb 2007 14:13:12 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [12.158.13.219] (HELO tpcexchange.pamperedchef.com) (12.158.13.219) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 15 Feb 2007 14:13:02 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: parameter map and like %?% query Date: Thu, 15 Feb 2007 16:12:40 -0600 Message-ID: <34BBE305D66DBC4D9B525141DCB7D73A0D29188A@tpcexchange.pamperedchef.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: parameter map and like %?% query Thread-Index: AcdRTaJkgmeBXTmRT7qDc+AkfrjeSwAABiPg From: "Todorovich, Milo" To: X-Virus-Checked: Checked by ClamAV on apache.org Instead of coding the % signs into your statements, make them a part of the parameter that is passed in. Here's an example: Then your code can call this statement like this: parameterMap.put("nameParm", "%"+nameParmValue+"%"); List results =3D sqlMapClient.queryForList("selectLikeName", parameterMap); Good luck! -Milo =20 -----Original Message----- From: cmose [mailto:cjmose@gmail.com]=20 Sent: Thursday, February 15, 2007 4:06 PM To: user-java@ibatis.apache.org Subject: parameter map and like %?% query I hope this isn't a blatantly obvious question but it may well be... I'm trying to do a LIKE query using either a parameter map or an inline parameter map and I can't seem to get that to work with the % and % characters, what I would like to do is something along the lines of LIKE %?% or LIKE %#value#% however, I can't seem to get that working. Every time I try it using %?% I get a mysql syntax error indicating that ibatis is adding quotes around the %'s e.g,. '%'value'%' which causes mysql to barf. I tried quoting the %?%, e.g., "%?%" but that causes ibatis to barf saying that it can't find a parameter... Does anyone have advice/can point out something obvious that I'm missing or is this just not possible? Thanks! -- View this message in context: http://www.nabble.com/parameter-map-and-like-----query-tf3236388.html#a8 994700 Sent from the iBATIS - User - Java mailing list archive at Nabble.com.