Return-Path: Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 10892 invoked by uid 99); 18 Jan 2005 18:59:49 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from web53104.mail.yahoo.com (HELO web53104.mail.yahoo.com) (206.190.39.207) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 18 Jan 2005 10:59:47 -0800 Received: (qmail 28009 invoked by uid 60001); 18 Jan 2005 18:59:45 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=px582bpNgWijhJGwY2dVFDHJdJQ2Ptd79Ray/lSgc61VGAoABmt78XNFA2Q39XISb5JSSC1TTlrfCa/2Z413NlM53YfZM0eWz1mT5zurREMCV9hEJ4KerhsVTjgVHCUYqYhyUx67My+tv2boeck9jH59mCZq+uwCWsAcrggTtMU= ; Message-ID: <20050118185945.28007.qmail@web53104.mail.yahoo.com> Received: from [20.137.2.51] by web53104.mail.yahoo.com via HTTP; Tue, 18 Jan 2005 10:59:45 PST Date: Tue, 18 Jan 2005 10:59:45 -0800 (PST) From: Prashanth Sukumaran Subject: RE: change in property value inside SELECT USERID, USERNAME, USERFNAME, USERLNAME, DECODE(USERINTERNAL,'YES','Internal','External') AS USERINTERNAL, TBLUSERLEVELS.LEVELNAME as USERLEVEL FROM TBLUSERS, TBLUSERLEVELS where TBLUSERS.USERLEVEL = TBLUSERLEVELS.LEVELSID AND TBLUSERS.ACTIVE = 'Y' AND TBLUSERLEVELS.ACTIVE = 'Y' userInternal = #userInternal# userInternal != #userInternal# userLevel = #userLevelId# userLevel != #userLevelId# lower(userFName) like lower(#userFirstName#) lower(userFName) like lower(#userFirstName#) lower(userFName) = lower(#userFirstName#) lower(userFName) != lower(#userFirstName#) lower(userLName) like lower(#userLastName#) lower(userLName) like lower(#userLastName#) lower(userLName) = lower(#userLastName#) lower(userLName) != lower(#userLastName#) lower(userName) like lower(#userName#) lower(userName) like lower(#userName#) lower(userName) = lower(#userName#) lower(userName) != lower(#userName#) ORDER BY USERNAME --- Philippe Laflamme wrote: > Personnaly, for many different reasons, I wouldn't use SQL keywords in a > Java bean... > > I suggest you use the power of iBatis and test your "userNameOptn" within > the SQLMap: > > [...] > > user_first_name LIKE #userFirstName# || '%'; > > > user_first_name LIKE '%' || #userFirstName# || '%'; > > [...] > > You can replace the || with whatever your RDBMS uses to concatenate strings. > > Philippe > > > -----Original Message----- > > From: Prashanth Sukumaran [mailto:prashanthsukumaran@yahoo.com] > > Sent: January 18, 2005 12:35 PM > > To: ibatis-user-java@incubator.apache.org > > Subject: Re: change in property value inside > > resultClass="java.util.HashMap"> > > > select ConsultantId, BlackListed, FirstName, LastName, > > > HomeTelephone, EmailAddress, InterviewGrade, TotalYrsOfExp from > > > Consultant > > > > > > FirstName like #FirstName# > > > LastName like #LastName# > > > ActiveInactive like #ActiveInactive# > > > > > > order by FirstName, LastName > > > > > > > > > For example, in the above case, when FirstName is present, > > is there a > > > way to attach '%' at the end of the FirstName's value and > > then perform > > > the select operation? > > > > > > For some reason, in the calling program, I won't be able to > > attach '%' > > > at the end of the search fields. Well, somehow I could achieve that > > > before the iBatis call is made, but I'm kindof hesitant to go with > > > that approach. So I was wondering is there any way to handle it in > > > iBatis layer. Any help is highly appreciated. > > > > > > Thanks > > > Nilesh > > > > > > > > > > > > > __________________________________ > > Do you Yahoo!? > > Take Yahoo! Mail with you! Get it on your mobile phone. > > http://mobile.yahoo.com/maildemo > > > > __________________________________ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail