Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

When used RTRIM,XMLAGG, XMLELEMENT togther then receives error - ORA-19011: Character string buffer

2909771Mar 28 2017 — edited Mar 29 2017

Hi,

Please help folks to optimize this query below where error I am getting is: ORA-19011: Character string buffer too small

SELECT pla.attribute1,  IMP.ORGANIZATION_ID,IMP.ORGANIZATION_code, SUM(plla.QUANTITY - plla.QUANTITY_RECEIVED) TO_SUMM,

(RTRIM (XMLAGG (XMLELEMENT (E, ' PO#'||pha.segment1 || '(' || IMP.ORGANIZATION_code || ')_'||plla.promised_date|| '_'|| (pla.line_num|| '.'|| plla.shipment_num|| ' x  QTY Due: '||(plla.QUANTITY - plla.QUANTITY_RECEIVED))

                   || ', ')ORDER BY plla.promised_date).EXTRACT (' //text()'), ', ') )  "ITEM_SUPP" --- pla.item_id

                   FROM po.po_line_locations_all plla,

          po.po_lines_all pla,

          po.po_headers_all pha,

          inv.MTL_PARAMETERS IMP

    WHERE     plla.closed_code = 'OPEN'

          AND plla.po_header_id = pha.po_header_id

          AND plla.po_line_id = pla.po_line_id

          AND pla.attribute1 IS NOT NULL         

          AND plla.SHIP_TO_ORGANIZATION_ID = IMP.ORGANIZATION_ID(+)

GROUP BY pla.attribute1, IMP.ORGANIZATION_ID,IMP.ORGANIZATION_code

ORDER BY IMP.ORGANIZATION_ID,  pla.attribute1

Thanks.

This post has been answered by Paulzip on Mar 28 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 26 2017
Added on Mar 28 2017
9 comments
4,410 views