绿色环保
千呼万唤死出来,一生一世很精彩

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;

posted on 2014-09-12 17:29  骷髅人  阅读(1997)  评论(0编辑  收藏  举报