oracle - xmltype character string buffer too small -


in stored procedure:

 declare v_xml xmltype; begin open v_cur select xmlelement('el',xmlagg(xmlelement('el2'))) table; loop fetch v_cur v_xml; -- line error   *.....additional logic parse v_xml* end loop; end; 

i'm getting "character string buffer small" error when record fetched v_xml has length > 4000. guys have idea on how go this? thanks

if use xmlagg(), you'll have add .getclobval() surrounding xmlelement() since char limit 4000 on xmlagg(). means you'll using clobs instead of xmltype have no choice, you'll have cast xmltype later if needed. example below:

declare v_xml clob; -- use clob begin open v_cur select xmlelement("el",xmlagg(xmlelement("el2", tab_col))).getclobval() table; -- add .getclobval() loop fetch v_cur v_xml; -- line error   *.....additional logic parse v_xml* end loop; end; 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -