CREATEORREPLACETYPE WM_CONCAT_IMPL AS OBJECT
(
CURR_STR VARCHAR2(32767),
STATIC FUNCTION ODCIAGGREGATEINITIALIZE(SCTX INOUT WM_CONCAT_IMPL)RETURN NUMBER,
MEMBER FUNCTION ODCIAGGREGATEITERATE(SELF INOUT WM_CONCAT_IMPL,
P1 IN VARCHAR2)RETURN NUMBER,
MEMBER FUNCTION ODCIAGGREGATETERMINATE(SELF IN WM_CONCAT_IMPL,
RETURNVALUE OUT VARCHAR2,
FLAGS IN NUMBER)RETURN NUMBER,
MEMBER FUNCTION ODCIAGGREGATEMERGE(SELF INOUT WM_CONCAT_IMPL,
SCTX2 IN WM_CONCAT_IMPL)RETURN NUMBER
);CREATEORREPLACETYPE BODY WM_CONCAT_IMPL
IS
STATIC FUNCTION ODCIAGGREGATEINITIALIZE(SCTX INOUT WM_CONCAT_IMPL)RETURN NUMBER
ISBEGIN
SCTX := WM_CONCAT_IMPL(NULL);RETURN ODCICONST.SUCCESS;END;
MEMBER FUNCTION ODCIAGGREGATEITERATE(SELF INOUT WM_CONCAT_IMPL,
P1 IN VARCHAR2)RETURN NUMBER
ISBEGINIF(CURR_STR ISNOTNULL)THEN
CURR_STR := CURR_STR ||','|| P1;ELSE
CURR_STR := P1;ENDIF;RETURN ODCICONST.SUCCESS;END;
MEMBER FUNCTION ODCIAGGREGATETERMINATE(SELF IN WM_CONCAT_IMPL,
RETURNVALUE OUT VARCHAR2,
FLAGS IN NUMBER)RETURN NUMBER
ISBEGIN
RETURNVALUE := CURR_STR ;RETURN ODCICONST.SUCCESS;END;
MEMBER FUNCTION ODCIAGGREGATEMERGE(SELF INOUT WM_CONCAT_IMPL,
SCTX2 IN WM_CONCAT_IMPL)RETURN NUMBER
ISBEGINIF(SCTX2.CURR_STR ISNOTNULL)THEN
SELF.CURR_STR := SELF.CURR_STR ||','|| SCTX2.CURR_STR ;ENDIF;RETURN ODCICONST.SUCCESS;END;END;CREATEORREPLACEFUNCTION wm_concat(P1 VARCHAR2)RETURN VARCHAR2 AGGREGATE USING WM_CONCAT_IMPL ;createorreplacepublic synonym WM_CONCAT_IMPL for sys.WM_CONCAT_IMPL
createorreplacepublic synonym wm_concat for sys.wm_concat
grantexecuteon WM_CONCAT_IMPL topublicgrantexecuteon wm_concat topublic