Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 12423 invoked from network); 2 Nov 2007 19:21:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Nov 2007 19:21:24 -0000 Received: (qmail 52966 invoked by uid 500); 2 Nov 2007 19:21:11 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 52479 invoked by uid 500); 2 Nov 2007 19:21:09 -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 52468 invoked by uid 99); 2 Nov 2007 19:21:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Nov 2007 12:21:09 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of goetzger@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 02 Nov 2007 19:21:32 +0000 Received: (qmail invoked by alias); 02 Nov 2007 19:20:51 -0000 Received: from stgt-590f114b.pool.einsundeins.de (EHLO [192.168.10.1]) [89.15.17.75] by mail.gmx.net (mp040) with SMTP; 02 Nov 2007 20:20:51 +0100 X-Authenticated: #286618 X-Provags-ID: V01U2FsdGVkX18T+RgPzlsTRbCmllE6WC4MrWAM78m4E9fOitB51k PfMxQBrTDKdvJr Message-ID: <472B7892.9060007@gmx.de> Date: Fri, 02 Nov 2007 20:20:50 +0100 From: =?ISO-8859-1?Q?Heinrich_G=F6tzger?= User-Agent: Thunderbird 2.0.0.6 (X11/20070803) MIME-Version: 1.0 To: user-java@ibatis.apache.org Subject: Re: HowTo add parameter to part of regex in select References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org Dave, Dave.Derry@Equifax.com wrote: > I'm far from being an expert, so I could be *way* off here. But I suspect > that the quoted string is what's causing problems with the variable > replacement. Maybe string concatenation would work; something like > > SELECT * FROM table WHERE > REGEXP_LIKE (id, '^(' || #id# || > ')\-[0]{4}[0-9][0-9][A-Z][0-9]{2}[A-Z]$') interesting idea, but on a short and quick test, it didn't work out. This may not be final. Thanks anyway. cheers Heinrich > > Dave > > We must begin not just to act, but to think, for there is no better slave > than the one who believes his slavery to be freedom, and we are in > no greater peril than when we cannot see the chains on our minds > because there are yet no chains on our feet. > -- Michael Reid > > > > > > Heinrich Gļæ½tzger > > To > 11/02/2007 01:24 user-java@ibatis.apache.org > PM cc > > Subject > Please respond to HowTo add parameter to part of > user-java@ibatis. regex in select > apache.org > > > > > > > > > > Hi, > > is there a possibility to get following to run with iBATIS? > > SELECT * FROM table WHERE > REGEXP_LIKE (id, > '^(#id#)\-[0]{4}[0-9][0-9][A-Z][0-9]{2}[A-Z]$') > > (remark: this is not working) > > or would I need to prepare the regexp in the java-part and use it like: > > SELECT * FROM table WHERE > REGEXP_LIKE (id, #id#) > > (remark: this is working) > > Or in other words: can i get iBATIS to only get part of the regex passed > and add it to the rest of an existing expression or would I need to > build the complete expression in Java and pass it as a regular > (string-)parameter to iBATIS-Layer? > > Thanks, cheers > > Heinrich > > >