Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 65608 invoked from network); 15 Jul 2005 14:17:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Jul 2005 14:17:01 -0000 Received: (qmail 9711 invoked by uid 500); 15 Jul 2005 14:16:59 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 9691 invoked by uid 500); 15 Jul 2005 14:16:58 -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 9677 invoked by uid 99); 15 Jul 2005 14:16:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2005 07:16:58 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of erlend.bjorge@aftenposten.no designates 80.91.34.51 as permitted sender) Received: from [80.91.34.51] (HELO mx1.aftenposten.no) (80.91.34.51) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jul 2005 07:16:53 -0700 Received: from localhost (amavis-mx1.aftenposten.no [80.91.34.52]) by mx1.aftenposten.no (Postfix) with ESMTP id EF6D18D8B77 for ; Fri, 15 Jul 2005 16:16:53 +0200 (CEST) Received: from smtp1.aftenposten.no (unknown [80.91.34.6]) by mx1.aftenposten.no (Postfix) with ESMTP id 8846C8D8B59 for ; Fri, 15 Jul 2005 16:16:52 +0200 (CEST) Received: from sch-mail-06.schibsted.no (unverified) by smtp1.aftenposten.no (Content Technologies SMTPRS 4.3.14) with ESMTP id for ; Fri, 15 Jul 2005 16:20:47 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: SV: multiple delete in sqlmap Date: Fri, 15 Jul 2005 16:16:51 +0200 Message-ID: <013F0E81D349EC42A14CD3242BC61AFFF9A92A@sch-mail-06.schibsted.no> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: multiple delete in sqlmap Thread-Index: AcWHwhxLR7JOzgLYRGq3RtiI39PZ9ABhPUPQ From: To: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi there! Is it related rows you are trying to delete ? Then you should define FK's between the NUM_OBJ's=20 on the tables and use casade delete, and delete=20 the row in the main table (FUN_OBJECT ??)=20 =3D only one delete statement !!!! But not sure if MySQL have cascade delete ?? Take care, Erlend =20 -----Opprinnelig melding----- Fra: olivier ZILLER [mailto:Olivier.Ziller@univ-nancy2.fr]=20 Sendt: 13. juli 2005 17:47 Til: user-java@ibatis.apache.org Emne: multiple delete in sqlmap hello, i'm using sqlmap and mysql and try to execute a delete statement like = this : delete from FUN_ERR_OBJ where NUM_OBJ =3D #numObj#; delete from FUN_INFO_OBJ_LOV where NUM_OBJ =3D #numObj#; delete from FUN_INFO_OBJ where NUM_OBJ =3D #numObj#; delete from FUN_GRP_INFO_OBJ where NUM_OBJ =3D #numObj#; delete from FUN_LANG_OBJ where NUM_OBJ =3D #numObj#; delete from FUN_ARB_OBJ where NUM_FILS_OBJ =3D #numObj#; delete from FUN_CDM_OBJ where NUM_OBJ =3D #numObj#; delete from FUN_PERS_OBJ where NUM_OBJ =3D #numObj#; delete from FUN_OBJET where NUM_OBJ =3D #numObj#; but i get this error : --- The error occurred in = /properties/channels/fr_unire/csof/sql-objet.xml. --- The error occurred while applying a parameter map. --- Check the deleteObjet-InlineParameterMap. --- Check the statement (update failed). --- Cause: java.sql.SQLException: Syntax error or access violation = message from server: "You have an error in your SQL syntax; check the = manual that corresponds to your MySQL server version for the right syntax to use near '; delete from FUN_INFO_OBJ_LOV where NUM_OBJ =3D 23; delete from F' at line 1" Caused by: java.sql.SQLException: Syntax error or access violation = message from server: "You have an error in your SQL syntax; check the = manual that corresponds to your MySQL server version for the right syntax to use near '; delete from FUN_INFO_OBJ_LOV where NUM_OBJ =3D 23; delete from F' at line 1" at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate= (GeneralStatement.java:87) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update(SqlMapExecuto= rDelegate.java:500) at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.delete(SqlMapExecuto= rDelegate.java:523) at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.delete(SqlMapSessionImpl.= java:93) at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.delete(SqlMapClientImpl.ja= va:65) at fr.unire.portal.channels.fun.csof.dao.ObjetDAO.deleteObjet(ObjetDAO.java:= 481) ... 18 more Caused by: java.sql.SQLException: Syntax error or access violation = message from server: "You have an error in your SQL syntax; check the = manual that corresponds to your MySQL server version for the right syntax to use near '; delete from FUN_INFO_OBJ_LOV where NUM_OBJ =3D 23; delete from F' at line 1" at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1997) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1167) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1278) at com.mysql.jdbc.Connection.execSQL(Connection.java:2247) at = com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1371) at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.ibatis.common.jdbc.logging.PreparedStatementLogProxy.invoke(PreparedS= tatementLogProxy.java:57) at $Proxy2.execute(Unknown Source) at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.= java:84) at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteUpd= ate(GeneralStatement.java:196) at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate= (GeneralStatement.java:74) ... 23 more any idea on how to do that? regards --=20 Olivier ZILLER CRI Gestion Universite NANCY2 25 rue Baron Louis BP 454 NANCY CEDEX tel: 03 54 00 11 12 / 06 85 74 89 77 / poste 604 fax : 03 83 30 05 65