ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <lmead...@apache.org>
Subject Re: How to deal with a char column in select statement
Date Fri, 06 Jan 2006 17:12:23 GMT
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 <m.tallet@delta-informatique.com> wrote:
> None : it's a legacy system (bad designed, no primary keys, no constraints 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 de Larry Meadors
> Envoyé: vendredi 6 janvier 2006 17:01
> À: 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 <m.tallet@delta-informatique.com> 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 the
> > length of the value : it can less than five characters.
> >
> >
> >
> > Here is my select statement in a sql map config file :
> >
> > <select id="select1" parameterClass="string" parameterMap="result-map" >
> >
> >             Select id, lib1, lib2 from myTable where id = #value#
> >
> > </select>
> >
> >
> >
> > 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 with a
> > spring class like JdbcTemplate
> >
> >
> >
> >
> >
> > Any help is greatly appreciated
> >
> >
> >
> > Regards,
> >
> > ____________________
> >
> > Michael Tallet
> >
> > Delta Informatique
> >
> >
>

Mime
View raw message