给个例子。

解决方案 »

  1.   

    declare
     l_sql varchar2(200);
    begin
     for c11 in (select distinct std_tbl from xxxxxx) loop
      l_sql := ' grant select, update, insert, delete on ' || c11.std_tbl || ' to user_yy;
      begin
       execute immediate l_sql;
      exception
       WHEN OTHERS THEN
        null;
      end;
     end loop;
    end;
    /
      

  2.   

    declare
     l_sql varchar2(200);
    begin
     for c11 in (select distinct std_tbl from CODER) loop
      l_sql := 'grant select,references on' || c11.std_tbl || 'to MEM';
      
      begin
       execute immediate l_sql;
      exception
       WHEN OTHERS THEN
        null;
      end;
     end loop;
    end;
    /我执行了下,说表 和视图不存在
      

  3.   

    使用toad 8.5以上版本中的multiple object privileges功能即可。