ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fabrizio Gianneschi" <fabrizio.giannes...@gruppoatlantis.com>
Subject R: multiple delete in sqlmap
Date Fri, 15 Jul 2005 13:53:24 GMT
Maybe it's a limitation of MySql...
 
Fab

  _____  

Da: olivier ZILLER [mailto:Olivier.Ziller@univ-nancy2.fr] 
Inviato: venerdì 15 luglio 2005 15.50
A: user-java@ibatis.apache.org
Oggetto: Re: multiple delete in sqlmap


you're right : it doesn't works...
it seems i'll have to create mutliple delete statements...

thanks

Larry Meadors a écrit : 

did you try to do this through JDBC?



Larry





On 7/13/05, olivier ZILLER  <mailto:Olivier.Ziller@univ-nancy2.fr>
<Olivier.Ziller@univ-nancy2.fr> wrote:

  

hello,



i'm using sqlmap and mysql and try to execute a delete statement like this :



    <!-- Suppression d'un objet -->

    <delete id="deleteObjet"

        parameterClass="fr.unire.portal.channels.fun.csof.beans.Objet" >

        delete from FUN_ERR_OBJ where NUM_OBJ = #numObj#;

        delete from FUN_INFO_OBJ_LOV where NUM_OBJ = #numObj#;

        delete from FUN_INFO_OBJ where NUM_OBJ = #numObj#;

        delete from FUN_GRP_INFO_OBJ where NUM_OBJ = #numObj#;

        delete from FUN_LANG_OBJ where NUM_OBJ = #numObj#;

        delete from FUN_ARB_OBJ where NUM_FILS_OBJ = #numObj#;

        delete from FUN_CDM_OBJ where NUM_OBJ = #numObj#;

        delete from FUN_PERS_OBJ where NUM_OBJ = #numObj#;

        delete from FUN_OBJET where NUM_OBJ = #numObj#;

    </delete>



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

= 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

= 23;         delete from F' at line 1"

    at

com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(Ge
neralStatement.java:87)

    at

com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update(SqlMapExecutorDe
legate.java:500)

    at

com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.delete(SqlMapExecutorDe
legate.java:523)

    at

com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.delete(SqlMapSessionImpl.jav
a:93)

    at

com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.delete(SqlMapClientImpl.java:
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

= 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(DelegatingMethodAccessorImpl
.java:25)

    at java.lang.reflect.Method.invoke(Method.java:324)

    at

com.ibatis.common.jdbc.logging.PreparedStatementLogProxy.invoke(PreparedStat
ementLogProxy.java:57)

    at $Proxy2.execute(Unknown Source)

    at

com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.jav
a:84)

    at

com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteUpdate
(GeneralStatement.java:196)

    at

com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(Ge
neralStatement.java:74)

    ... 23 more



any idea on how to do that?



regards





--

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



    



  


-- 

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

Mime
View raw message