You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Eugeny N Dzhurinsky <bo...@redwerk.com> on 2006/09/19 15:01:38 UTC

dynamic tables names in query problem

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).

-- 
Eugene N Dzhurinsky

Re: dynamic tables names in query problem

Posted by Eugeny N Dzhurinsky <bo...@redwerk.com>.
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