zoukankan      html  css  js  c++  java
  • 修改wm_concat逗号分隔符为!

    create or replace type MyConcatImpl as object
    (
    str VARCHAR2(32767), -- second highest value seen so far
    static function ODCIAggregateInitialize(sctx IN OUT MyConcatImpl)
    return number,
    member function ODCIAggregateIterate(self IN OUT MyConcatImpl,
    value IN VARCHAR2) return number,
    member function ODCIAggregateTerminate(self IN MyConcatImpl,
    returnValue OUT VARCHAR2, flags IN number) return number,
    member function ODCIAggregateMerge(self IN OUT MyConcatImpl,
    ctx2 IN MyConcatImpl) return number
    );
    /

    create or replace type body MyConcatImpl is
    static function ODCIAggregateInitialize(sctx IN OUT MyConcatImpl)
    return number is
    begin
    sctx := MyConcatImpl(NULL);
    return ODCIConst.Success;
    end;

    member function ODCIAggregateIterate(self IN OUT MyConcatImpl, value IN VARCHAR2) return number is
    begin
    if self.str is not null then
    self.str := self.str || '!' || value;
    else
    self.str := value;
    end if;
    return ODCIConst.Success;
    end;

    member function ODCIAggregateTerminate(self IN MyConcatImpl, returnValue OUT VARCHAR2, flags IN number) return number is
    begin
    returnValue := self.str;
    return ODCIConst.Success;
    end;

    member function ODCIAggregateMerge(self IN OUT MyConcatImpl, ctx2 IN MyConcatImpl) return number is
    begin
    if ctx2.str is not null then
    self.str := self.str || '!' || ctx2.str;
    end if;
    return ODCIConst.Success;
    end;
    end;
    /
    create or replace FUNCTION MyConcat(input VARCHAR2) RETURN VARCHAR2
    PARALLEL_ENABLE AGGREGATE USING MyConcatImpl;

    --select entityidsdf, MyConcat (distinct namesdf ) namesdf from TD22_SDFS_ELEMENTS where ROWNUM <= 10

    group by entityidsdf ;

  • 相关阅读:
    Codeforces Round #251 (Div. 2) A
    topcoder SRM 623 DIV2 CatAndRat
    topcoder SRM 623 DIV2 CatchTheBeatEasy
    topcoder SRM 622 DIV2 FibonacciDiv2
    topcoder SRM 622 DIV2 BoxesDiv2
    Leetcode Linked List Cycle II
    leetcode Linked List Cycle
    Leetcode Search Insert Position
    关于vim插件
    Codeforces Round #248 (Div. 2) B. Kuriyama Mirai's Stones
  • 原文地址:https://www.cnblogs.com/mayhh/p/11269596.html
Copyright © 2011-2022 走看看