ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nilesh Bhattad" <nil...@outlinesys.com>
Subject problem while inserting a record with MONEY datatype
Date Tue, 19 Apr 2005 06:08:41 GMT
<insert id="insert" parameterClass="java.util.HashMap">
          insert into testbit(testbit, testmoney) values (#testbit#,
      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] 
--- 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

View raw message