Your XML is simply invalid, use an editor that supports DTD validation.
The selectKey element can only be used inside select elements.

I also think that resultClass="java.lang.Long" is obsolete, and should
be removed.

Niels

-----Original Message-----
From: StevenF [mailto:ste...@web2.filipowicz.com] 
Sent: Friday, January 22, 2010 11:32 PM
To: user-java@ibatis.apache.org
Subject: Re: insert going wrong after going from Sybase to MySQL


Hi Thanks for the reply!

Ok so I did this:

    <statement id = "insertChesser"
parameterClass="nl.chessone40.domain.Chesser"
resultClass="java.lang.Long">
        INSERT INTO Chesser
            (login,
            password,
            firstName,
            lastName,
            credits)
        values
            (#login#,
            #password#,
            #firstName#,
            #lastName#,
            #credits#)
    <selectKey resultClass="int" keyProperty="value">
      select last_insert_id() as value
    </selectKey>
    </statement>

But this doesn't work. The project doesn't even start in Tomcat/Eclipse.

In eclipse it gives this error msg: "The content of element type must
match
(include|dynamic|and a whole lot more...)"

I'm no expert at Ibatis, but when I normally would do an insert, I would
use
<insert id="xxxx" parameterClass...etc> I don't really understand why
<statement id="xxxx" parameterClass...etc> is used.

I'm using Ibatis version 2.3.4

Any ideas what could be wrong here? Thanks a million!


CORRECTION

select last_insert_id()

Damn these fat fingers

--- On Fri, 2
-- 
View this message in context:
http://old.nabble.com/insert-going-wrong-after-going-from-Sybase-to-MySQ
L-tp27274795p27280982.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org
For additional commands, e-mail: user-java-h...@ibatis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org
For additional commands, e-mail: user-java-h...@ibatis.apache.org

Reply via email to