Oracle字符串拼接过长问题
0
Hello各位专家,
我需要将类似如下数据拼接起来:
希望得到如下的两列结果:
week MondayTuesdayWednesdayThursdayFridaySaturdaySunday
查询语句如下:
select aa,listagg(to_clob(cc),'') within group (order by bb) as txt from test_table group by aa
实际环境中文本很长,查询会产生错误:
ORA-01489: result of string concatenation is too long
01489. 00000 - "result of string concatenation is too long"
*Cause: String concatenation result is more than the maximum size.
*Action: Make sure that the result is less than the maximum size.
原因基本上清楚了,就是拼接后的文本长度超过4000字符,那么如何将过长的结果截断呢?查了网上(渡娘+谷歌),都没有相关的解答,还请专家们帮忙看看,想想法子,非常感谢!
我需要将类似如下数据拼接起来:
希望得到如下的两列结果:
week MondayTuesdayWednesdayThursdayFridaySaturdaySunday
查询语句如下:
select aa,listagg(to_clob(cc),'') within group (order by bb) as txt from test_table group by aa
实际环境中文本很长,查询会产生错误:
ORA-01489: result of string concatenation is too long
01489. 00000 - "result of string concatenation is too long"
*Cause: String concatenation result is more than the maximum size.
*Action: Make sure that the result is less than the maximum size.
原因基本上清楚了,就是拼接后的文本长度超过4000字符,那么如何将过长的结果截断呢?查了网上(渡娘+谷歌),都没有相关的解答,还请专家们帮忙看看,想想法子,非常感谢!
没有找到相关结果
重要提示:提问者不能发表回复,可以通过评论与回答者沟通,沟通后可以通过编辑功能完善问题描述,以便后续其他人能够更容易理解问题.
2 个回复
大连海龙 - 70后,生产ERP,SSIS/SSRS 2016-02-26 回答
赞同来自:
老头子 - 专注是唯一的捷径 2016-02-26 回答
赞同来自: li052468
from dba_objects t
group by t.OWNER