--User-defined-function CREATE OR REPLACE TYPE T_string_agg as OBJECT ( G_string VARCHAR2 (32767), STATIC FUNCTION odciaggregateinitialize (sctx in Out T_string_agg) return number, Member FUNCTION odciaggregateiterate (self in out T_string_agg, value in VARCHAR2) return number, Member FUNCTION odciaggregateterminate (self in T_string_agg, returnvalue out VARCHAR2, flags in number) return number, Member FUNCTION Odciaggregatemerge (self in out T_string_agg, ctx2 in T_string_agg) return number ), / CREATE OR REPLACE TYPE body T_string_agg is STATIC FUNCTION odciaggregateinitialize (sctx in out t_string_agg) Return number are BEGIN sctx: = T_string_agg (NULL); return Odcico Nst. Success; End; Member FUNCTION odciaggregateiterate (self in out T_string_agg, value in VARCHAR2) return number is BEGIN & nbsp; self.g_string: = self.g_string | | ',' || Value return odciconst.success; End; Member FUNCTION odciaggregateterminate (self in T_string_agg, returnvalue out VARCHAR2, flags in number) return number is BEGIN returnvalue: = RTRIM (LTRIM (self.g_string, ', '), ', '); return odciconst.success; End; Member FUNCTION Odciaggregatemerge (self in Out T_string_agg, CTX2 in T_string_agg) Return number is BEGIN Self.g_string: = self.g_string | | ',' || ctx2.g_string; return odciconst.success; End; End; / CREATE OR REPLACE FUNCTION string_agg (p_input VARCHAR2) Return VARCHAR2 Parallel_enable AGGREGATE USING T_string_agg; / |