PL/SQL (MOSC)

MOSC Banner

ORA-06502: PL/SQL: numeric or value error: character string buffer too small

edited Jun 21, 2012 3:25AM in PL/SQL (MOSC) 2 commentsAnswered
Hi All,
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,ccccccccccc

20      ddddddddddd,eeeeeeeeeee,fffffffffff

 

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

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center