Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 6952 invoked from network); 16 Oct 2007 17:27:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Oct 2007 17:27:44 -0000 Received: (qmail 79909 invoked by uid 500); 16 Oct 2007 17:27:30 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 79892 invoked by uid 500); 16 Oct 2007 17:27:30 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 79881 invoked by uid 99); 16 Oct 2007 17:27:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Oct 2007 10:27:30 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.44.121.252] (HELO investoranalytics.com) (208.44.121.252) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Oct 2007 17:27:33 +0000 Received: from [10.1.1.11] (HELO [10.1.1.11]) by investoranalytics.com (CommuniGate Pro SMTP 4.3.7) with ESMTP id 3128370 for user-java@ibatis.apache.org; Tue, 16 Oct 2007 13:27:11 -0400 Message-ID: <4714F471.1030402@investoranalytics.com> Date: Tue, 16 Oct 2007 13:27:13 -0400 From: Lisa Jenkins User-Agent: Thunderbird 1.5.0.4 (Macintosh/20060516) MIME-Version: 1.0 To: user-java@ibatis.apache.org Subject: Re: How to achieve Dynamic SQL query in delete statement References: <13235168.post@talk.nabble.com> <2f55db670710160951t69dfe685qc16e3aa3e09a5b12@mail.gmail.com> In-Reply-To: <2f55db670710160951t69dfe685qc16e3aa3e09a5b12@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Actually, you can use 1 map and call it 10 times, with delete from $tablename$ $whereClause$as the query. And pass parmMap for tablename and whereClause vars. Nathan Maves wrote: > Not sure how you are going to avoid writing 10 different sql > statements.... and now you have some sql based in two different > places (.java and .xml). > > I think you are over thinking this and would have already been done if > you just placed the 10 delete statements in your sqlmap files :) > > of course this is just my opinion > > Nathan > > On 10/16/07, *Navanee* > wrote: > > > Hi > > Is there a way to pass dynamic Query values to delete statement. > like below > > > $value$ > > > 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 . > >