ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koka Kiknadze" <226...@gmail.com>
Subject Re: Ibatis :: [usage of IN]
Date Fri, 13 Apr 2007 08:13:17 GMT
Using #mi_id# tells iBatis to prepare statement
SELECT * FROM message where m_id IN( ? )  ...
and obviuosly it'll return records with m_id="1,2,3,4"  (i.e. not (1 or 2 or
3 or 4) but whole string "1,2,3,4").
Simplest way is to use $mi_id$. The $ signs tell iBatis to substitute
$mi_id$ with actual string (i.e. 1,2,3,4) and create statement after that

I think usually you'll have values needed for IN clause stored in some kind
of list or array. For that case look for <iterate> tag in iBatis docs.

View raw message