1 --Create Type2 CREATE OR REPLACETYPE "T_link_lob" asOBJECT3 (4 V_lob CLOB,5STATICFUNCTIONOdciaggregateinitialize (sctxinchOut NOCOPY t_link_lob)6 RETURN Number,7MEMBERFUNCTIONOdciaggregateiterate (selfinchOut NOCOPY T_link_lob,8VALUEinch VARCHAR2)RETURN Number,9MEMBERFUNCTIONOdciaggregateterminate (selfinchT_link_lob,Ten returnvalue out NOCOPY CLOB, OneFLAGSinch Number) A RETURN Number, -MEMBERFUNCTIONOdciaggregatemerge (selfinchOut NOCOPY T_link_lob, -CTX2inchT_LINK_LOB)RETURN Number the ); - - --Create type content - CREATE OR REPLACETYPE BODY T_link_lob is +STATICFUNCTIONOdciaggregateinitialize (sctxinchOut NOCOPY t_link_lob) - RETURN Number is + BEGIN ASctx:=T_link_lob (NULL); at Dbms_lob. Createtemporary (Sctx. V_lob, TRUE, Dbms_lob. SESSION); -Dbms_lob.OPEN(Sctx. V_lob, Dbms_lob. Lob_readwrite); - RETURNOdciconst. SUCCESS; - END; - -MEMBERFUNCTIONOdciaggregateiterate (selfinchOut NOCOPY T_link_lob, inVALUEinch VARCHAR2)RETURN Number is - BEGIN toDbms_lob. Writeappend (self. V_lob, LENGTH (VALUE)+ 1, VALUE|| ','); + RETURNOdciconst. SUCCESS; - END; the *MEMBERFUNCTIONOdciaggregateterminate (selfinchT_link_lob, $ returnvalue out NOCOPY CLOB,Panax NotoginsengFLAGSinch Number)RETURN Number is - BEGIN the Dbms_lob. Createtemporary (ReturnValue, TRUE, Dbms_lob. Call); + Dbms_lob. COPY (ReturnValue, A Self . V_lob, theDbms_lob. GetLength (self. V_LOB)- 1); + RETURNOdciconst. SUCCESS; - END; $ $MEMBERFUNCTIONOdciaggregatemerge (selfinchOut NOCOPY T_link_lob, -CTX2inchT_LINK_LOB)RETURN Number is - BEGIN the NULL; - RETURNOdciconst. SUCCESS;Wuyi END; the END; - Wu --Create a function - CREATE OR REPLACE FUNCTIONF_link_lob (p_strVARCHAR2)RETURNCLOB AGGREGATE USING t_link_lob; About $ --Invocation Mode - SelectF_link_lob (D.SID) fromPmp_p_info D;
Solve the problem of insufficient length of wm_concat function