ORA-06502: PL/SQL: numeric or value error: character string buffer too small
I am facing the following issue, Please help me.
deptid ename
------ ------
10 aaaaaaaaaaa
10 bbbbbbbbbbb
10 ccccccccccc
20 ddddddddddd
20 eeeeeeeeeee
20 fffffffffff
select deptno, string_agg(ename) ename
from emp
group by deptno;
deptno concat_enames
------ -------------
10 aaaaaaaaaaa,bbbbbbbbbbb,
20 ddddddddddd,eeeeeeeeeee,
now the issue is, while aggregating, if the dept_id 10 has more than 32767 characters length it will throw an error
like
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
Is there anyother way to concatenate?
while running this query it wont throw any error...
while importing this data into excel sheet it will return error like this