jeudi 16 juin 2016

Oracle : String Concatenation is too long

I have below SQL as a part of a view. In one of the schema I am getting "String Concatenation is too long" error and not able to execute the view.

Hence I tried the TO_CLOB() and now VIEW is not throwing ERROR, but it not returning the result as well it keep on running..

Please suggest....

Sql:

SELECT Iav.Item_Id Attr_Item_Id,
LISTAGG(La.Attribute_Name
    ||'|~|'
    || Lav.Attribute_Value
    ||' '
    || Lau.Attribute_Uom, '}~}') WITHIN GROUP (
  ORDER BY ICA.DISP_SEQ,LA.ATTRIBUTE_NAME) AS ATTR
    FROM Item_Attribute_Values Iav,
      Loc_Attribute_Values Lav,
      Loc_Attribute_Uoms Lau,
      Loc_Attributes La,
      (SELECT *
      FROM Item_Classification Ic,
        CATEGORY_ATTRIBUTES CA
      WHERE IC.DEFAULT_CATEGORY='Y'
      AND IC.TAXONOMY_TREE_ID  =CA.TAXONOMY_TREE_ID
      ) ICA
    WHERE IAV.ITEM_ID             =ICA.ITEM_ID(+)
    AND IAV.ATTRIBUTE_ID          =ICA.ATTRIBUTE_ID(+)
    AND Iav.Loc_Attribute_Id      =La.Loc_Attribute_Id
    AND La.Locale_Id              =1
    AND Iav.Loc_Attribute_Uom_Id  =Lau.Loc_Attribute_Uom_Id(+)
    AND Iav.Loc_Attribute_Value_Id=Lav.Loc_Attribute_Value_Id
    GROUP BY Iav.Item_Id;

Error:

ORA-01489: result of string concatenation is too long
01489. 00000 -  "result of string concatenation is too long"
*Cause:    String concatenation result is more than the maximum size.
*Action:   Make sure that the result is less than the maximum size.

Aucun commentaire:

Enregistrer un commentaire