开发者

procedure issue(error in syntax)

开发者 https://www.devze.com 2023-01-23 20:43 出处:网络
I have the procedure block: begin for i in (select grantee ,table_name ,privilege from user_tab_privs_made

I have the procedure block:

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;

and the error occurs:

procedure issue(error in syntax)


You need to issue the revoke as EXECUTE IMMEDIATE, building a dynamic string with the command you want to be executed:

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

精彩评论

暂无评论...
验证码 换一张
取 消