ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Pitts" <Daniel.Pi...@cnet.com>
Subject RE: dynamic tables names in query problem
Date Tue, 19 Sep 2006 14:41:52 GMT
Your iterate tag needs to specify what its iterating.
I forget off the top of my head, but I think it's the value attribute.

"<iterate conjunction=" union all " value="values"> select * from
task_url_$values[]$</iterate>"

-----Original Message-----
From: Eugeny N Dzhurinsky [mailto:bofh@redwerk.com] 
Sent: Tuesday, September 19, 2006 6:33 AM
To: user-java@ibatis.apache.org
Subject: Re: dynamic tables names in query problem

On Tue, Sep 19, 2006 at 04:01:38PM +0300, Eugeny N Dzhurinsky wrote:
> I'm trying to do this:
> 
>     <statement id="prepareView" parameterClass="list">
>         create temporary view task_url_view as
>         <dynamic>
>             <iterate conjunction=" union all ">
>                 select * from task_url_$values[]$
>             </iterate>
>         </dynamic>
>     </statement>
> 
> but this seems not work -
> weird exception is thrown: ERROR - relation task_url_$1 does not 
> exists
> 
> I'm calling this statement as SqlMapClient.update("prepareView",list).

Sorry, I missed - in the SQL map there is select * from
task_url_#values[]#

with $values[]$ it doesn't want to work at all, complaining : 

ERROR - There is no READABLE property named 'values' in class
'java.util.ArrayList'

--
Eugene N Dzhurinsky

Mime
View raw message