-4

我正在尝试创建一个程序来删除某个用户的系统权限。当我编译我的代码时,我得到“编译错误”

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;
/
4

1 回答 1

1

IN声明中缺少您FOR;它应该是:

FOR rec IN (SELECT privilege, admin_option FROM dba_sys_privs
            WHERE grantee = l_username) LOOP

请参阅http://docs.oracle.com/cd/E11882_01/appdev.112/e17126/static.htm#CIHCGJAD

于 2013-02-11T20:50:48.423 回答