ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Darek Dober" <doover...@op.pl>
Subject Re: multiple delete in sqlmap
Date Fri, 15 Jul 2005 14:58:31 GMT
According to that what I know mysql in version 3.xx doesn't support
constraints at all:), also subqueries, triggers and so on ...

Version 4.xx has some of that futures. Check documentation. I'm not up to
date with mysql now:)

But, check i.e here. Probably it is not supported

http://groups.google.pl/group/mailing.database.myodbc/browse_thread/thread/baec3bd2912db274/f249f35401b287d0?q=mysql+multiple+statement+jdbc&rnum=2&hl=pl#f249f35401b287d0

It depends on that what version of mysql you are using.

Darek


----- Original Message ----- 
From: <erlend.bjorge@aftenposten.no>
To: <user-java@ibatis.apache.org>
Sent: Friday, July 15, 2005 4:16 PM
Subject: SV: multiple delete in sqlmap


Hi there!

Is it related rows you are trying to delete ?

Then you should define FK's between the NUM_OBJ's
on the tables and use casade delete, and delete
the row in the main table (FUN_OBJECT ??)

    = only one delete statement !!!!

But not sure if MySQL have cascade delete ??


Take care,
Erlend



-----Opprinnelig melding-----
Fra: olivier ZILLER [mailto:Olivier.Ziller@univ-nancy2.fr]
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 :

    <!-- 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


Mime
View raw message