CREATE OR REPLACE FUNCTION GetSplitName(v_value IN VARCHAR2)
RETURN VARCHAR2 IS
strSql VARCHAR2(2000) := ' select listagg(username,'|| '''' || ',' || ''''||
') within group (order by rownum) from sec_userinfo where loginname in (select * from table(split_STR(';
strName VARCHAR2(2000) := '';
get_matou_ sys_refcursor;
BEGIN
strSql := strSql || v_value || ',' || '''' || ',' || '''' || ')))';
Dbms_Output.put_line(strSql);
begin
Open get_matou_ FOR strSql;
Fetch get_matou_
Into strName;
Close get_matou_;
end;
RETURN strName;
END GetSplitName;
转载于:https://www.cnblogs.com/kendyhuang/archive/2013/06/09/3129563.html