Thank
you very much, i´ll try ir with the iterate.
-----Original Message-----Yep. You want the <iterate> element for dynamic queries. It will help you avoid the risks of $substring$ replacement. The months value in the map should be a List or array[] of integers. The year shoudl be an integer or a string, depending on how your database is designed.
From: Clinton Begin [mailto:[EMAIL PROTECTED]
Sent: Jueves, 27 de Julio de 2006 04:02 p.m.
To: [email protected]
Subject: Re: problems with dynamic sql
Cheers,
Clinton
On 7/27/06, Celaya, Tina (GE Indust, ConsInd) <[EMAIL PROTECTED]> wrote:I want to put somthing like this in de query moths in (1,2,3,4,5,6) and I tried using month in ($list$) and list have integers 1,2,3,4,5,6 but it doesnt work, i have an error that says invalid colum '1,2,3,4,5,6' and i dont know how to solve this so i can have this query
select * from table where months in (1,2,3,4,5) and year=year
i have this but is not working
<select id="nameID" parameterClass="java.util.Map" resultClass="someClass">
select * from table where months in ($months$) and year=#year#
and i sent a parameter hashmap than has hashmap.add("year",year) and hashmap.add("months",monthsList) and moths is a List with integers
thanks for your help
Tina Celaya
GE Consumer & Industrial
Systems Analyst
