ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chris...@student.matnat.uio.no
Subject MS Access selectKey question
Date Wed, 28 Sep 2005 07:23:09 GMT
Hey,
Im having some difficulties inserting rows into ms access. The error i get
is:

...
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in org/hisp/dhis/hmis/RoutineData.ibatis.xml. ---
The error occurred while applying a parameter map.
--- Check the addRoutineDataValue-InlineParameterMap.
--- Check the parameter mapping for the 'id' property.
--- Cause: java.sql.SQLException: [Microsoft][ODBC Microsoft Access
Driver]Invalid SQL-datatype
...

So im guessing there is something wrong with my selectkey. This is my query:

 <insert id="addRoutineDataValue" parameterClass="java.util.Map">
    <selectKey resultClass="int" keyProperty="id">
      SELECT MAX(RoutineDataID)+1 AS ID FROM RoutineData
    </selectKey>
    INSERT INTO RoutineData (
        RoutineDataID,
        DataElementID,
        DataPeriodID,
        OrgUnitID,
        EntryNumber,
        LastUserID,
        LastUpdated,
        Comment
      )
      VALUES (
        #id#,
        #dataElementId#,
        #periodId#,
        #source#,
        #value#,
        #storedBy#,
        #timestamp#,
        #comment#
      )
  </insert>

any help would be greatly appreciated.. :)




Mime
View raw message