我正在尝试创建一个程序来删除某个用户的系统权限。当我编译我的代码时,我得到“编译错误”
create or replace procedure deactivate_user
(
p_username in varchar2
)
as
l_username varchar2(30):=upper(p_username);
cnmd varchar2(50);
begin
for rec (select privilege, admin_option from dba_sys_privs
where grantee = l_username) loop
cnmd := 'REVOKE '||rec.privilege||' from '||l_username;
execute immediate cnmd;
end loop;
end;
/