If I used iteration, I'd have a lot of queries. Since this database can scale to be pretty huge, I'd prefer to not do that.
Also, the information isn't blindly pulled from a form, and then jammed into the database. Validation does happen. And it worked. Thanks kindly. :) -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Larry Meadors Sent: December 8, 2005 12:26 PM To: [email protected] Subject: Re: Multiple deletes? You could do this: DELETE FROM ALERTS WHERE ID IN ($value$) It is beggin for SQL injection, but...it will work. A better route would be to use iteration to do it. Larry On 12/8/05, Michael Laccetti [c] <[EMAIL PROTECTED]> wrote: > I have the following statement defined in iBATIS: > > <delete id="deleteAlerts" parameterClass="java.lang.String"> > DELETE FROM ALERTS WHERE ID IN (#value#) </delete> > > I pass it a String in the form of 322,321,320,319,318,317,316,315,314,313. > > Now, when I call it, I get the following: > DEBUG [08 Dec 05 11:19:26] [http-8080-Processor23] > java.sql.PreparedStatement - {pstm-100004} PreparedStatement: DELETE > FROM ALERTS WHERE ID IN (?) > DEBUG [08 Dec 05 11:19:26] [http-8080-Processor23] > java.sql.PreparedStatement - {pstm-100004} Parameters: > [322,321,320,319,318,317,316,315,314,313] > DEBUG [08 Dec 05 11:19:26] [http-8080-Processor23] > java.sql.PreparedStatement - {pstm-100004} Types: [java.lang.String] > ERROR [08 Dec 05 11:19:26] [http-8080-Processor23] > com.cibcwm.go.otis.gowmon.web.struts.action.IndexAction - Could not > remove > alert(s) from database. > com.ibatis.common.jdbc.exception.NestedSQLException: > --- The error occurred in conf/gowmon.xml. > --- The error occurred while applying a parameter map. > --- Check the deleteAlerts-InlineParameterMap. > --- Check the statement (update failed). > --- Cause: org.apache.derby.client.am.SqlException: Invalid character > string format for type INTEGER. > > I know that the statement itself is valid; I can run it directly no problem. > The question is, how do I get this to work with iBATIS. > > Mike > > > > -- ------------------------ [ SECURITY NOTICE ] ------------------------ To: [EMAIL PROTECTED] For your security, [EMAIL PROTECTED] digitally signed this message on 08 December 2005 at 22:12:00 UTC. Verify this digital signature at http://www.ciphire.com/verify. ------------------- [ CIPHIRE DIGITAL SIGNATURE ] ------------------- Q2lwaGlyZSBTaWcuAjh1c2VyLWphdmFAaWJhdGlzLmFwYWNoZS5vcmcAbWljaGFlbEBzM mctbGltaXRlZC5jb20AZW1haWwgYm9keQAWBwAAfAB8AAAAAQAAALCvmEMWBwAA1AIAAg ACAAIAIIXYnAvwVJnXYkeNqqLiR5ZyHRK7W0tiTAYcV7p1uX8mAQAxTkdmLdtsIbMe4FE 6BpyDx/u9eVN0WyoQPcWCmWDyD4nx1YYqYYJFhJjvEsvbzUkcDGWnSTD5jThDnRCEWtKE XaAcU2lnRW5k --------------------- [ END DIGITAL SIGNATURE ] ---------------------
