nested exception is java.sql.SQLException: ORA-00932: 数据类型不一致: 应为 -, 但却获得 CLOB


问题:nested exception is java.sql.SQLException: ORA-00932: 数据类型不一致: 应为 -, 但却获得 CLOB

原因是条件查询时,我的库中的类型是clob类型就报错了,

解决方法:

改成 to_char(a.progressAndPlan),

如:

if (StringHelper.isNotEmpty(bMentorid)){
// selectSql=selectSql + "and field005 ='"+bMentorid+"' ";
String[] objnames = new String[0];
objnames = bMentorid.split(",");
String bMentorids="";
for (int i=0;i if (i==objnames.length-1){
bMentorids=bMentorids+"'"+objnames[i]+"'";
}else {
bMentorids=bMentorids+"'"+objnames[i]+"'"+",";
}
}
selectSql=selectSql + " and to_char(field005) in ("+bMentorids+") ";

bMentoridname=dateservice.getValue("select objname from humres where id in ("+bMentorids+")");//企业导师名称
}