CREATE OR REPLACE TYPE agg_t AS OBJECT (
str_agg VARCHAR2(4000),
STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT agg_t)
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateIterate(self IN OUT agg_t,
value IN VARCHAR2) RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateTerminate(self IN agg_t,
return_value OUT VARCHAR2, flags IN NUMBER) RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateMerge(self IN OUT agg_t,
ctx2 IN agg_t) RETURN NUMBER
);
/
CREATE OR REPLACE TYPE BODY agg_t IS
STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT agg_t)
RETURN NUMBER IS
BEGIN
sctx := agg_t(null);
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateIterate(
self IN OUT agg_t, value IN VARCHAR2)
RETURN NUMBER IS
BEGIN
str_agg := str_agg || value;
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateTerminate(self IN agg_t,
return_value OUT VARCHAR2, flags IN NUMBER) RETURN NUMBER IS
BEGIN
return_value := str_agg;
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateMerge(self IN OUT agg_t,
ctx2 IN agg_t) RETURN NUMBER IS
BEGIN
str_agg := str_agg || ctx2.str_agg;
RETURN ODCIConst.Success;
END;
END;
/
CREATE OR REPLACE FUNCTION GroupConcat (input VARCHAR2) RETURN VARCHAR2
PARALLEL_ENABLE aggregate USING agg_t;
/
'IT-Consultant' 카테고리의 다른 글
etheral 다운로드 주소 (0) | 2009.04.22 |
---|---|
Oracle 10 XE 버전 설치 (0) | 2009.04.21 |
startUML 사용법 설명(UseCase 다이어그램 모델링하기) (0) | 2009.04.10 |
KMS 활용 동영상 날리지큐브 편... (0) | 2009.04.10 |
extjs의 gridpanel에서 오른쪽 스크롤바가 생기도록 하는 방법 (0) | 2009.04.10 |