create or replace function Fun_GetRoleIDList(d_fid char) return varchar is
rolelist varchar(2000);
begin
rolelist := '';
---定义游标
declare cursor role_cur is select a.roleid from u_roleinfo a , u_node_roles b where a.roleid=b.roleid and b.fid=d_fid ;
begin
---循环
for roles in role_cur loop
rolelist := rolelist || roles.roleid || ',';---赋值
end loop;
end;
return(rolelist);---返回
end Fun_GetRoleIDList;