首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

java.sql.SQLException: ORA-00932: 数据类型不一致: 应为 - 但却取得 CLOB

2012-07-25 
java.sql.SQLException: ORA-00932: 数据类型不一致: 应为 -, 但却获得 CLOBselect distinct a.id,a.curre

java.sql.SQLException: ORA-00932: 数据类型不一致: 应为 -, 但却获得 CLOB
select distinct a.id,
                a.currentHandle,
                a.progressAndPlan,
                a.customerService,
                c.fullname as customerServiceName,
                d.fullname as currentHandleName
  from defect1 a
  left join user_info c on a.customerService = c.user_id
  left join user_info d on a.currentHandle = d.user_id
  left join site1_attr e on a.siteID = e.site_id, dir_status b
where 1 = 1
   and a.status = b.id
   and a.createTime >=
       to_date('2012-03-01 00:00:00', 'yyyy-mm-dd HH24:mi:ss')
   and a.createTime <=
       to_date('2012-03-31 23:59:59', 'yyyy-mm-dd HH24:mi:ss')
   and a.B_versionName = 'OCS R002C02LG0305'
   order by createTime desc

总是报:ORA-00932: 数据类型不一致: 应为 -, 但却获得 CLOB

是由于这个a.progressAndPlan字段clob字段。

第一种解决方法: a.progressAndPlan 改成 to_char(a.progressAndPlan)。
第二种解决方法: 去掉distinct 去重。
第三种解决方法: 在下一篇文章中。

热点排行