<insert id="insert" parameterClass="java.util.HashMap">

          insert into testbit(testbit, testmoney) values (#testbit#, #testmoney:NUMERIC#)

      </insert>

 

      The above iBatis call throws below exception --

 

DEBUG - {pstm-100001} PreparedStatement:            insert into testbit(testbit, testmoney) values (?, ?)      

DEBUG - {pstm-100001} Parameters: [1, 3434.1234]

DEBUG - {pstm-100001} Types: [java.lang.String, java.lang.String]

com.ibatis.common.jdbc.exception.NestedSQLException:  

--- Cause: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Disallowed implicit conversion from data type nvarchar to data type money, table 'crmdb.dbo.testbit', column 'testmoney'. Use the CONVERT function to run this query.

 

It works fine if testmoney is passed in Double format. Would I be able to pass testmoney in String and give a hint into iBatis query to convert into appropriate data type before making the SQL call?

 

~ Nilesh

Reply via email to