大家好,又见面了,我是你们的朋友全栈君。
oracle拼接字符串函数(去重和不去重)
1.不去重FUNCTION f_link
Function f_link
CREATE OR REPLACE FUNCTION f_link (p_str VARCHAR2)
RETURN VARCHAR2 PARALLEL_ENABLE AGGREGATE
USING t_link;
Type t_link
CREATE OR REPLACE TYPE T_LINK AS OBJECT
(
str VARCHAR2(30000),
–currentseprator varchar2(8),
STATIC FUNCTION odciaggregateinitialize(sctx IN OUT t_link) RETURN NUMBER,
MEMBER FUNCTION odciaggregateiterate(SELF IN OUT t_link,
VALUE IN VARCHAR2) RETURN NUMBER,
MEMBER FUNCTION odciaggregateterminate(SELF IN t_link,
returnvalue OUT VARCHAR2,
flags IN NUMBER)
RETURN NUMBER,
MEMBER FUNCTION odciaggregatemerge(SELF IN OUT t_link, ctx2 IN t_link)
RETURN NUMBER
)
CREATE OR REPLACE TYPE BODY T_LINK IS
STATIC FUNCTION odciaggregateinitialize(sctx IN OUT t_link) RETURN NUMBER IS
BEGIN
sctx := t_link(NULL);
RETURN odciconst.success;
END;
MEMBER FUNCTION odciaggregateiterate(SELF IN OUT t_link,
VALUE IN VARCHAR2) RETURN NUMBER IS BEGIN
SELF.str := SELF.str || ‘;’ || VALUE;
RETURN odciconst.success;
END;
MEMBER FUNCTION odciaggregateterminate(SELF IN t_link,
returnvalue OUT VARCHAR2,
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/191270.html原文链接:https://javaforall.cn