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: SQL 'IN' clause
Date Thu, 19 Jan 2006 13:28:49 GMT
Look at the iterate tags.

Larry


On 1/19/06, Jorge DeCastro <jorge.decastro@flightcentre.co.uk> wrote:
> Hi all,
>
> I am using iBatis 2.1.6 with SQLServer and I can't make dynamic queries
> work with SQL's 'IN' clause.
> I have the string 'airlineFilter'.
> If I pass a string containing one value (airlineFilter = "BA"), it works
> fine. If I pass a comma-separated string of values (airlineFilter =
> "BA,QF") to the dynamic IN clause, iBatis passes it as a single string and
> hence I don't get the results I expect.
>
>
>           <dynamic prepend="AND">
>                 <isNotNull property="airlineFilter">
>                         (PubAirRuleFlightRestriction.CarrierCode IN (#airlineFilter#))
>             </isNotNull>
>           </dynamic>
>
> cheers
> j.
>
>

Mime
View raw message