ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Navanee <navaneethankr...@yahoo.com>
Subject How to achieve Dynamic SQL query in delete statement
Date Tue, 16 Oct 2007 14:57:34 GMT

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 this message in context: http://www.nabble.com/How-to-achieve-Dynamic-SQL-query-in-delete-statement-tf4634689.html#a13235168
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Mime
View raw message