2013-09-30 63 views
0

我在SQL Server 2008安裝中遇到此錯誤。我正試圖將數據插入到特定的表中,並且出現此錯誤。隱式轉換表單數據類型datetime到varbinary(max) - 無varbinary列

ERROR - JDBCExceptionReporter - Implicit conversion from data type datetime to varbinary(max) is not allowed. Use the CONVERT function to run this query.

只是要注意,我有沒有變種二進制列的任何地方,我不知道爲什麼我得到這個問題的人有任何想法?

我沒有SQL源代碼,但我可以告訴你的Hibernate映射

<?xml version="1.0"?> 
<!DOCTYPE hibernate-mapping PUBLIC 
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> 
<hibernate-mapping> 
    <class name="tester.model.TellerTotal" table="TELLER_TOTAL"> 
     <id name="id" type="string"> 
      <column name="ID" not-null="true" length="32"></column> 
      <generator class="uuid.hex"></generator> 
     </id> 
     <version name="version" type="java.lang.Integer"> 
      <column name="VERSION" not-null="true" /> 
     </version> 
     <property name="del" type="java.lang.Integer"> 
      <column name="DEL" not-null="true" /> 
     </property> 
     <property name="txnType" type="java.lang.Integer"> 
      <column name="TRAN_TYPE" not-null="true" /> 
     </property> 
     <property name="txnRefNo" type="string"> 
      <column name="TRAN_REF_NO" not-null="false"/> 
     </property> 
     <many-to-one name="denomCcy" class="tester.model.Currency" fetch="select" insert="false" update="false" property-ref="cd"> 
      <column name="DENOM_CCY" /> 
     </many-to-one> 
     <property name="denomCcyCd" type="string"> 
      <column name="DENOM_CCY" not-null="true" length="10" /> 
     </property> 
     <property name="denom" type="java.math.BigDecimal"> 
      <column name="DENOM" not-null="true" length="19" /> 
     </property> 
     <property name="billType" type="java.lang.Integer"> 
      <column name="BILL_TYPE" not-null="true" /> 
     </property> 
     <property name="cashFlag" type="java.lang.Integer"> 
      <column name="CASH_FLAG" not-null="true" /> 
     </property> 
     <property name="totalDenomCnt" type="java.lang.Long"> 
      <column name="TOT_DENOM_CNT" not-null="true" /> 
     </property> 
     <many-to-one name="usr" class="tester.model.TestUsr" fetch="select" insert="false" update="false"> 
      <column name="USER_CD" not-null="false" length="32" /> 
     </many-to-one> 
     <property name="usrCd" type="string"> 
      <column name="USER_CD" length="32" not-null="false"/> 
     </property> 
     <property name="ecFlag" type="java.lang.Integer"> 
      <column name="EC_FLAG" not-null="true" /> 
     </property> 
     <many-to-one name="branch" class="tester.model.Branch" fetch="select" insert="false" update="false" property-ref="cd"> 
      <column name="BRANCH_CD" not-null="false" length="32" /> 
     </many-to-one> 
     <property name="branchCd" type="string"> 
      <column name="BRANCH_CD" length="32" not-null="false"/> 
     </property> 
     <property name="boxCd" type="string"> 
      <column name="BOX_CD" length="32" not-null="false"/> 
     </property> 
     <property name="tranDt" type="java.util.Date"> 
      <column name="TRAN_DT" not-null="false"/> 
     </property> 
     <property name="createDt" type="java.util.Date"> 
      <column name="CREATE_DT" not-null="false"/> 
     </property> 
    </class> 
</hibernate-mapping> 

Datbase結構

腳本使用:SELECT COLUMN_NAME , DATA_TYPE AS DataType FROM INFORMATION_SCHEMA.Columns where TABLE_NAME = 'TELLER_TOTAL' ;

COLUMN_NAME     DataType 
--------------    ----------- 
ID       varchar  
VERSION      int   
DEL       int   
TRAN_TYPE     int   
TRAN_REF_NO     varchar  
DENOM_CCY     varchar  
DENOM      money  
BILL_TYPE     int   
DR_FLAG      int   
CASH_FLAG     int   
TOT_DENOM_CNT    bigint  
USER_CD      varchar  
ec_flag      int   
branch_cd     varchar  
box_cd      varchar  
CREATE_DT     datetime 
TRAN_DT      datetime 
+1

顯示您的代碼(與SQL)。 – Dhwani

回答

0

對不起,打擾大家

原因是桌子上的觸發器正在寫到varbinary列

謝謝

相關問題