CREATE OR REPLACE FUNCTION SMTUSER.rowconcat(q in VARCHAR2) RETURN VARCHAR2 IS
ret VARCHAR2(4000);
hold VARCHAR2(4000);
cur sys_refcursor;
BEGIN
OPEN cur FOR q;
LOOP
FETCH cur INTO hold;
EXIT WHEN cur%NOTFOUND;
IF ret IS NULL THEN
ret := hold;
ELSE
ret := ret || ',' || hold;
END IF;
END LOOP;
RETURN ret;
END;
/
posted on 2009-09-08 08:12
Ke 阅读(283)
评论(0) 编辑 收藏 所属分类:
oracle