-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: ERROR:ORA-00932: inconsistent datatypes
PostPosted: Thu Aug 18, 2005 11:58 pm 
Regular
Regular

Joined: Tue Dec 30, 2003 2:35 am
Posts: 85
ERROR:ORA-00932: inconsistent datatypes
Hi every one:
i write the follow code,use hibernate3.0

Code:
Transaction tx = null;
try {
tx = (Transaction) session.beginTransaction();
Query q = null;
q = session.createQuery("From Cssb as cssb where cssb.flag=:FLAG ORDER BY cssb.czrkslsj desc");
q.setFirstResult(0);
q.setMaxResults(1000);
q.setString("FLAG", "000");
List objList = q.list();
int j = objList.size();
for (int i = 0; i < j; i++) {
     Cssb objCssb = (Cssb) objList.get(0);
     ....objCssb.getCzrkssssxq()
     ....all code only read the objCssb

     //i want mark a flag.
     objCssb.setFlag("abc");
     session.update(objCssb);
     session.flush();      //here i got a ORA-00932: inconsistent datatypes error
}
tx.commit();
} catch (Exception ex) {
tx.rollback();
ex.printStackTrace();
}

table:
Code:
create table CSSB
(
  CHANGEID       VARCHAR2(30) not null,
  CZRKSSSSXQ     CHAR(6) not null,
  CZRKGMSFHM     CHAR(18) not null,
  CZRKXM         VARCHAR2(30) not null,
  CZRKXB         CHAR(1) not null,
  CZRKMZ         CHAR(2) not null,
  CZRKCSRQ       CHAR(8) not null,
  CZRKCSDGJ      CHAR(3),
  CZRKCSDSSX     CHAR(6),
  CZRKCSDXZ      VARCHAR2(40),
  CZRKJGGJ       CHAR(3),
  CZRKJGSSX      CHAR(6),
  CZRKJHRYHM     VARCHAR2(18),
  CZRKJHRYXM     VARCHAR2(30),
  CZRKJHRYGX     VARCHAR2(2),
  CZRKJHREHM     VARCHAR2(18),
  CZRKJHREXM     VARCHAR2(30),
  CZRKJHREGX     VARCHAR2(2),
  CZRKFQHM       VARCHAR2(18),
  CZRKFQXM       VARCHAR2(30),
  CZRKMQHM       VARCHAR2(18),
  CZRKMQXM       VARCHAR2(30),
  CZRKXX         CHAR(1),
  CZRKZZ         VARCHAR2(70) not null,
  CZRKCSDJLB     VARCHAR2(4) not null,
  CZRKCSZMBH     VARCHAR2(20),
  CZRKYWLX       VARCHAR2(2) not null,
  CZRKSLSJ       DATE not null,
  CZRKXZJDMC     VARCHAR2(40),
  CZRKXJGAJGMC   VARCHAR2(40) not null,
  CZRKXJGAJGJGDM CHAR(12) not null,
  CZRKPCSMC      VARCHAR2(40) not null,
  CZRKPCSJGDM    CHAR(12) not null,
  CZRKRYID       VARCHAR2(30) not null,
  FLAG           VARCHAR2(3) not null
)

hbm.xml

Code:
<?xml version="1.0" encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
                            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
                            "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration.                   -->
<!-- Created Thu Aug 18 11:36:21 CST 2005                         -->
<hibernate-mapping package="com.hibernate.senddatachange.pojo">

    <class name="Cssb" table="CSSB">
        <id name="changeid" column="CHANGEID" type="string">
            <generator class="assigned"/>
        </id>
        <property name="czrkssssxq" column="CZRKSSSSXQ" type="string"  not-null="true" />
        <property name="czrkgmsfhm" column="CZRKGMSFHM" type="string"  not-null="true" />
        <property name="czrkxm" column="CZRKXM" type="string"  not-null="true" />
        <property name="czrkxb" column="CZRKXB" type="string"  not-null="true" />
        <property name="czrkmz" column="CZRKMZ" type="string"  not-null="true" />
        <property name="czrkcsrq" column="CZRKCSRQ" type="string"  not-null="true" />
        <property name="czrkcsdgj" column="CZRKCSDGJ" type="string" />
        <property name="czrkcsdssx" column="CZRKCSDSSX" type="string" />
        <property name="czrkcsdxz" column="CZRKCSDXZ" type="string" />
        <property name="czrkjggj" column="CZRKJGGJ" type="string" />
        <property name="czrkjgssx" column="CZRKJGSSX" type="string" />
        <property name="czrkjhryhm" column="CZRKJHRYHM" type="string" />
        <property name="czrkjhryxm" column="CZRKJHRYXM" type="string" />
        <property name="czrkjhrygx" column="CZRKJHRYGX" type="string" />
        <property name="czrkjhrehm" column="CZRKJHREHM" type="string" />
        <property name="czrkjhrexm" column="CZRKJHREXM" type="string" />
        <property name="czrkjhregx" column="CZRKJHREGX" type="string" />
        <property name="czrkfqhm" column="CZRKFQHM" type="string" />
        <property name="czrkfqxm" column="CZRKFQXM" type="string" />
        <property name="czrkmqhm" column="CZRKMQHM" type="string" />
        <property name="czrkmqxm" column="CZRKMQXM" type="string" />
        <property name="czrkxx" column="CZRKXX" type="string" />
        <property name="czrkzz" column="CZRKZZ" type="string"  not-null="true" />
        <property name="czrkcsdjlb" column="CZRKCSDJLB" type="string"  not-null="true" />
        <property name="czrkcszmbh" column="CZRKCSZMBH" type="string" />
        <property name="czrkywlx" column="CZRKYWLX" type="string"  not-null="true" />
        <property name="czrkslsj" column="CZRKSLSJ" type="java.sql.Timestamp"  not-null="true" />
        <property name="czrkxzjdmc" column="CZRKXZJDMC" type="string" />
        <property name="czrkxjgajgmc" column="CZRKXJGAJGMC" type="string"  not-null="true" />
        <property name="czrkxjgajgjgdm" column="CZRKXJGAJGJGDM" type="string"  not-null="true" />
        <property name="czrkpcsmc" column="CZRKPCSMC" type="string"  not-null="true" />
        <property name="czrkpcsjgdm" column="CZRKPCSJGDM" type="string"  not-null="true" />
        <property name="czrkryid" column="CZRKRYID" type="string"  not-null="true" />
        <property name="flag" column="FLAG" type="string"  not-null="true" />
    </class>
   
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 19, 2005 7:57 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Problem can be only column CZRKSLSJ (date)
What is type for this in java ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.