ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lisa Jenkins <lisa.jenk...@investoranalytics.com>
Subject Re: How to achieve Dynamic SQL query in delete statement
Date Tue, 16 Oct 2007 15:04:52 GMT
I think you've listed your own solution.  The hanging may be a db issue, 
meaning the time it takes for the query to execute/number of rows it 
takes to process.  How long does it take the query to run outside of 
iBatis (when running directly on the db)?

Navanee wrote:
> Hi
> Is there a way to pass dynamic Query values to delete statement. like below 
>     <delete id="trimTable"  parameterClass="String" >       
>         $value$        
>     </delete>         
> In my case, I need to delete some ten tables, But I want to have only one
> delete sql map statement like above instead of having ten different SQL
> statement,
> I'll pass the $value$ as below for all tables,
>            String dynamicQuery = "DELETE FROM TABLE1 WHERE NAME = 'TEST'";
>             sqlMapper.delete("trimTable",dynamicQuery);
> I wrote a sample code to achive the above, but during execution the code
> hangs and does not come out of it, when there is a valid data to delete, But
> finishes it execution where there is no data in the table.
> What might cause the above issue, is there any workaround/solution for
> this... 
> Could someone please share/provide solution on this?
> Thanks and Regards,
> Navanee

View raw message