FROM (XMLAGG(TRIM(BR_NAME.SLA_BUSINESS_RULE_NAME)|| ','
ORDER BY BR_NAME.GU_PRIMARY_NAME) (VARCHAR(10000)))) BUSINESS_RULE_NAME
FROM GRMTBVDB.BV_CUSTOMER_PARTY_HIERARCHY C
JOIN GRMTBVDB.BV_APSP_SVC_LEVEL_AGREEMENT B
JOIN GRMTBVDB.BV_APSP_SLA_BUSINESS_RULE A
WHERE B.SLA_PHASE_CD IN ('Management')
GROUP BY 1,
GROUP BY 1,2
I am executing above query but it is failing satying that (2513 A data is too long). Request you to please help me
What are the data types for C.GU_PRIMARY_NAME,A.SLA_BUSINESS_RULE_CLASS_CD,A.SLA_BUSINESS_RULE_NAME? Are any of them VARCHAR with excessive max length (perhaps much greater than any actual data length)? You may need to CAST/SUBSTRING them to something shorter.
When you GROUP BY a VARCHAR column, the spool row will contain a copy of the value placed in a CHAR column padded to the declared max length.