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 <[EMAIL PROTECTED]> 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(GeneralStatement.java:87)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.update(SqlMapExecutorDelegate.java:500)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.delete(SqlMapExecutorDelegate.java:523)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.delete(SqlMapSessionImpl.java: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(PreparedStatementLogProxy.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.sqlExecuteUpdate(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
--
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
|
- Re: multiple delete in sqlmap olivier ZILLER
-