过程问题(语法错误)

时间:2010-11-05 08:22:05

标签: oracle

我有程序块:

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;

并发生错误:

alt text

1 个答案:

答案 0 :(得分:6)

您需要将撤销发布为EXECUTE IMMEDIATE,使用您要执行的命令构建动态字符串:

execute immediate 'revoke ' || i.privilege || ' on ' || i.table_name
    || ' from ' || i.grantee;