ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Jenkins <krisajenk...@yahoo.co.uk>
Subject Re: Using the IN operator
Date Thu, 20 Jan 2005 18:35:25 GMT
Mike Zatko wrote:

> Hello. I have the following query which uses an IN operator.
>
> SELECT
> SNAPSHOT_TIMESTAMP as snapShotTimestamp, INSTANCE_NAME as serverName, 
> sum(IFL_USAGE) as usage
> FROM
> vmiflgrp.VM_IFL_STATS where
> SNAPSHOT_TIMESTAMP between '2005-01-14 00:00:00.000000' AND 
> '2005-01-15 00:00:00.000000'
> AND  INSTANCE_NAME in ('LXDB01','LXWADM1','LXWAPP1','LXWEB1')
>
> GROUP BY SNAPSHOT_TIMESTAMP,INSTANCE_NAME
>
>
> How would I substitute the values 
> "'LXDB01','LXWADM1','LXWAPP1','LXWEB1'" in sqlmaps?
>
> Thanks!
>
Search for 'iterate' in the developer's guide.  It's a dynamic SQL tag 
that will let you turn a java.util.List into a comma-seperated list in 
the query.

HTH,
Kris


-- 
Kris Jenkins
Email:  kris@jenkster.com
Blog:   http://cafe.jenkster.com/
Wiki:   http://wiki.jenkster.com/


Mime
View raw message