Code CREATEORREPLACEFUNCTION GetRoleUser
(
Proleid admin_list.roles_id %TYPE
) RETURNvarchar2--函数返回类型 IS
Userlists varchar2(4000); cursor mycur is select admin_list.admin_name into Userlists from admin_list where admin_list.roles_id=Proleid;
ccrec mycur%rowtype; begin begin --打开游标 open mycur; --loop循环 loop --提取一行数据到ccrec中 fetch mycur into ccrec; --判断是否提取到值,没取到值就退出 --取到值cc%notfound 是false --取不到值cc%notfound 是true exitwhen mycur%notfound;
Userlists:=Userlists||ccrec.admin_name||','; end loop; --关闭游标 close mycur; end;
return Userlists; END GetRoleUser;
posted on
2008-12-16 15:02gwazy
阅读(174)
评论(0)
编辑收藏举报