美文网首页
ORA-01489: 字符串连接的结果过长 错误的原因以及解决办

ORA-01489: 字符串连接的结果过长 错误的原因以及解决办

作者: 西谷haul | 来源:发表于2021-11-19 10:02 被阅读0次
问题

问题语句如下:

select role_cd,listagg(xm.nm,',')within group(order by role_cd)name 
from xap_role_menu xrm 
left join xap_menu xm
on xrm.menu_cd = xm.menu_cd
where xrm.del_f ='0'
and xm.del_f ='0'
and xrm.role_cd='XAPM14.01'
group by role_cd;

修改后的语句如下:利用xmlagg + xmlparse语法

select role_cd,xmlagg(xmlparse(content xm.nm||',')order by role_cd).getclobval()
from xap_role_menu xrm 
left join xap_menu xm
on xrm.menu_cd = xm.menu_cd
where xrm.del_f ='0'
and xm.del_f ='0'
and xrm.role_cd='XAPM14.01'
group by role_cd;

相关文章

网友评论

      本文标题:ORA-01489: 字符串连接的结果过长 错误的原因以及解决办

      本文链接:https://www.haomeiwen.com/subject/lmustrtx.html