ORA-22922: 不存在的 LOB 值解决办法


报错语句:

select n1.cpname,n1.cids ,xx.* from (
select 
t.cpname,max(t.dz) dz ,count(cid) sbs,to_char( wm_concat(t.cid)) cids  
from VIEW_YQJMTZ_CID_INFO t where t.lx = '1'
group by t.cpname ) n1, VIEW_YQJMTZ_CID_INFO xx
where n1.cpname = xx.cpname

但是单独执行里面的子查询不报错

select 
t.cpname,max(t.dz) dz ,count(cid) sbs,to_char( wm_concat(t.cid)) cids  
from VIEW_YQJMTZ_CID_INFO t where t.lx = '1'
group by t.cpname 

 

修改后语句:

select n1.cpname,to_char(n1.cids) ,xx.* from (
select 
t.cpname,max(t.dz) dz ,count(cid) sbs, wm_concat(t.cid) cids  
from VIEW_YQJMTZ_CID_INFO t where t.lx = '1'
group by t.cpname ) n1, VIEW_YQJMTZ_CID_INFO xx
where n1.cpname = xx.cpname

 

初步判断,应该是wm_concat函数处理过的字段为clob类型,需要进行关联时,不能先进行to_char,只能在最后数据查询结果展示层进行to_char.

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM