Here's my script
I have created aggregate string function
'Tab_To_String' using this below script CREATE OR REPLACE TYPE t_varchar2_tab AS TABLE OF VARCHAR2(4000); CREATE OR REPLACE FUNCTION Tab_To_String (p_varchar2_tab IN t_varchar2_tab, p_delimiter IN VARCHAR2 DEFAULT ',') RETURN VARCHAR2 IS l_string VARCHAR2(32767); BEGIN FOR i IN p_varchar2_tab.FIRST .. p_varchar2_tab.LAST LOOP IF i != p_varchar2_tab.FIRST THEN l_string := l_string || p_delimiter; END IF; l_string := l_string || p_varchar2_tab(i); END LOOP; RETURN l_string; END Tab_To_String; i have one TABLE mst_attribute The mst_attribute TABLE having two column attribute_code varchar2 NOT NULL attribute_value varchar2 NOT NULL both are PRIMARY KEY WHEN i execute the following script i get "ORA-06502: PL/SQL: numeric or value error: character string buffer too small" error SELECT attribute_code, Tab_To_String(CAST(COLLECT(attribute_value) AS t_varchar2_tab)) possible_values FROM mst_attribute GROUP BY attribute_code
Is any one having solution for this error? How to resolve this?
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 1  Reply