ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jorge DeCastro" <jorge.decas...@flightcentre.co.uk>
Subject SQL 'IN' clause
Date Thu, 19 Jan 2006 13:15:47 GMT
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