当我跑步时
SQL>execute deactivate_user
我收到错误:
SQL> exec deactivate_user
BEGIN deactivate_user; END;
*
第 1 行出现错误:ORA-06550:第 1 行,第 7 列:PLS-00306:调用“DEACTIVATE_USER”时参数的数量或类型错误 ORA-06550:第 1 行,第 7 列:PL/SQL:语句被忽略
这是我的代码:
create or replace procedure deactivate_user
(
p_username varchar2
)
as
l_username varchar2(30):=upper(p_username);
cnmd varchar2(50);
begin
for rec in (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;
/