• 重构wm_concat,采用clob做为存储容器


    --Type
    CREATE OR REPLACE TYPE zh_concat_im AUTHID CURRENT_USER AS OBJECT
    (
    CURR_STR clob,
    STATIC FUNCTION ODCIAGGREGATEINITIALIZE(SCTX IN OUT zh_concat_im)
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAGGREGATEITERATE(SELF IN OUT zh_concat_im,
    P1 IN VARCHAR2) RETURN NUMBER,
    MEMBER FUNCTION ODCIAGGREGATETERMINATE(SELF IN zh_concat_im,
    RETURNVALUE OUT clob,
    FLAGS IN NUMBER)
    RETURN NUMBER,
    MEMBER FUNCTION ODCIAGGREGATEMERGE(SELF IN OUT zh_concat_im,
    SCTX2 IN zh_concat_im) RETURN NUMBER
    );
    --TYPE BODY
    CREATE OR REPLACE TYPE BODY zh_concat_im IS
    STATIC FUNCTION ODCIAGGREGATEINITIALIZE(SCTX IN OUT zh_concat_im)
    RETURN NUMBER IS
    BEGIN
    SCTX := zh_concat_im(NULL);
    RETURN ODCICONST.SUCCESS;
    END;
    MEMBER FUNCTION ODCIAGGREGATEITERATE(SELF IN OUT zh_concat_im,
    P1 IN VARCHAR2) RETURN NUMBER IS
    BEGIN
    IF (CURR_STR IS NOT NULL) THEN
    CURR_STR := CURR_STR || ',' || P1;
    ELSE
    CURR_STR := P1;
    END IF;
    RETURN ODCICONST.SUCCESS;
    END;
    MEMBER FUNCTION ODCIAGGREGATETERMINATE(SELF IN zh_concat_im,
    RETURNVALUE OUT clob,
    FLAGS IN NUMBER) RETURN NUMBER IS
    BEGIN
    RETURNVALUE := CURR_STR;
    RETURN ODCICONST.SUCCESS;
    END;
    MEMBER FUNCTION ODCIAGGREGATEMERGE(SELF IN OUT zh_concat_im,
    SCTX2 IN zh_concat_im) RETURN NUMBER IS
    BEGIN
    IF (SCTX2.CURR_STR IS NOT NULL) THEN
    SELF.CURR_STR := SELF.CURR_STR || ',' || SCTX2.CURR_STR;
    END IF;
    RETURN ODCICONST.SUCCESS;
    END;
    END;
    --FUNCTION
    create or replace FUNCTION zh_concat(P1 VARCHAR2) RETURN clob AGGREGATE USING zh_concat_im;
  • 相关阅读:
    前端技术-PS切图
    Html5资料整理
    Html5知识体系
    Html知识体系
    C语言知识结构
    ASP.NET知识结构
    src和href的区别
    Ajax的简单使用
    学习理论
    求模运算法则
  • 原文地址:https://www.cnblogs.com/james1207/p/3260677.html
Copyright © 2020-2023  润新知