Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 47596 invoked from network); 6 Jan 2006 17:12:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jan 2006 17:12:48 -0000 Received: (qmail 25029 invoked by uid 500); 6 Jan 2006 17:12:45 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 25002 invoked by uid 500); 6 Jan 2006 17:12:44 -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 24991 invoked by uid 99); 6 Jan 2006 17:12:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2006 09:12:44 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of larry.meadors@gmail.com designates 66.249.82.203 as permitted sender) Received: from [66.249.82.203] (HELO xproxy.gmail.com) (66.249.82.203) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2006 09:12:44 -0800 Received: by xproxy.gmail.com with SMTP id s19so1851924wxc for ; Fri, 06 Jan 2006 09:12:23 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NSNZx/NLZc3RoiMOyYJVb+D0dlV6B22TLXAxHh/mawkJ9ojuqhk2700XvOFBAHko6vj/BL2GjAuhi2o5TmT9gXJL/0o52A6r8apICWZNG37xfGXt8OO8JZCXX8F0yTedXlWsWDJDJcVGFYJVdJJRShZLH/Z0wDBa3g4o1mfshMs= Received: by 10.70.91.7 with SMTP id o7mr3125196wxb; Fri, 06 Jan 2006 09:12:23 -0800 (PST) Received: by 10.70.75.18 with HTTP; Fri, 6 Jan 2006 09:12:23 -0800 (PST) Message-ID: Date: Fri, 6 Jan 2006 10:12:23 -0700 From: Larry Meadors Reply-To: lmeadors@apache.org Sender: larry.meadors@gmail.com To: user-java@ibatis.apache.org Subject: Re: How to deal with a char column in select statement In-Reply-To: <5B7D2ACE8204B748980CEB2DBFAB90B3972D80@mail.delta-informatique.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <5B7D2ACE8204B748980CEB2DBFAB90B3972D80@mail.delta-informatique.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I see, ok...maybe you can deal with it in the DAO layer and the mapped statements (like Niels and Nathan suggested). Larry On 1/6/06, Michael TALLET wrote: > None : it's a legacy system (bad designed, no primary keys, no constraint= s at all, char columns) > In a perfect world I would have primary keys, varchar columns... > > ____________________ > Michael Tallet > Delta Informatique > > -----Message d'origine----- > De: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com] De la part d= e Larry Meadors > Envoy=E9: vendredi 6 janvier 2006 17:01 > =C0: user-java@ibatis.apache.org > Objet: Re: How to deal with a char column in select statement > > Just curious: What is the added value of using CHAR instead of VARCHAR > in this case? > > Larry > > > On 1/6/06, Michael TALLET wrote: > > > > > > > > Hi, > > > > > > > > I have to query on tables which have CHAR columns (length 5 for example= ) as > > ID. > > > > Let's say we have some lines with these ID values : XXXXX, YYYYY, ZZZ = [2 > > white spaces at the end]. As u can see there is no restriction about th= e > > length of the value : it can less than five characters. > > > > > > > > Here is my select statement in a sql map config file : > > > > > > > > > > > > Here is the problem : if I use the value "ZZZ" as parameter value then = the > > statement finds no result. I must pass "ZZZ " value to make the query = ok > > > > My connection (an oracle connection actually) has the > > "fixed[Default]String" property set to true, provided by an initial > > properties file. > > > > The strange thing is : the query (with this "ZZZ" value) works fine wi= th a > > spring class like JdbcTemplate > > > > > > > > > > > > Any help is greatly appreciated > > > > > > > > Regards, > > > > ____________________ > > > > Michael Tallet > > > > Delta Informatique > > > > >