I am executing the below query in oracle and the following error comes up
ORA-19011 : Character string buffer too small
select Rtrim(Xmlagg (Xmlelement (e, wonum || ',')).extract ( '//text()' ), ',')
as wolist
from ( select w.wonum from workorder w
connect by prior w.wonum = w.parent and prior w.siteid = siteid
start with w.siteid = 'ABCD' and w.wonum = 'P1234' )
I have never used Xmlagg/Xmlelement hence I am not sure what's the issue. When the inner query is executed then the output would be like below
select w.wonum from workorder w
connect by prior w.wonum = w.parent
and prior w.siteid = siteid
start with w.siteid = 'ABCD' and w.wonum = 'P1234'
wonum parent
P1234
5678 P1234
9999 5678
8888 9999
and so on...