我有程序块:
begin
for i in (select grantee
,table_name
,privilege
from user_tab_privs_made
where grantee='TEST')
loop
revoke i.privilege on i.table_name from i.grantee;
end loop;
end;
并发生错误:
答案 0 :(得分:6)
您需要将撤销发布为EXECUTE IMMEDIATE,使用您要执行的命令构建动态字符串:
execute immediate 'revoke ' || i.privilege || ' on ' || i.table_name
|| ' from ' || i.grantee;