wm_cancat

Posted xsdf

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了wm_cancat相关的知识,希望对你有一定的参考价值。

select con_id,dbid,NAME,OPEN_MODE from v$pdbs; 
alter session set container=PDBORCL;
create or replace type type_concat authid current_user as object
(
  curr_str varchar2(32767),
  static function odciaggregateinitialize(sctx in out type_concat)
    return number,
  member function odciaggregateiterate(self in out type_concat,
                                       p1   in varchar2) return number,
  member function odciaggregateterminate(self        in type_concat,
                                         returnvalue out varchar2,
                                         flags       in number)
    return number,
  member function odciaggregatemerge(self  in out type_concat,
                                     sctx2 in type_concat) return number
)
;
/

create or replace type body type_concat is
  static function odciaggregateinitialize(sctx in out type_concat)
    return number is
  begin
    sctx := type_concat(null);
    return odciconst.success;
  end;
  member function odciaggregateiterate(self in out type_concat,
                                       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 type_concat,
                                         returnvalue out varchar2,
                                         flags       in number) return number is
  begin
    returnvalue := curr_str;
    return odciconst.success;
  end;
  member function odciaggregatemerge(self  in out type_concat,
                                     sctx2 in type_concat) 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;
/

--函数: 
create or replace FUNCTION WM_CONCAT(P1 VARCHAR2) RETURN VARCHAR2 AGGREGATE USING type_concat;

  

以上是关于wm_cancat的主要内容,如果未能解决你的问题,请参考以下文章

VSCode自定义代码片段——CSS选择器

谷歌浏览器调试jsp 引入代码片段,如何调试代码片段中的js

片段和活动之间的核心区别是啥?哪些代码可以写成片段?

VSCode自定义代码片段——.vue文件的模板

VSCode自定义代码片段6——CSS选择器

VSCode自定义代码片段——声明函数