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<objnames.length;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+")");//企业导师名称
}
posted @   java璀璨小菜鸟  阅读(1550)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· AI 智能体引爆开源社区「GitHub 热点速览」
点击右上角即可分享
微信分享提示