权限问题请教

建了一个package,需要查询和操作其他schema中的表

方法一:
create role role1;
grant select,insert,update,delete on schema2.tablename to role1;
grant role1 to schema1;

在package中,使用
select column1 into var1 from schema2.tablename;

出现错误:
ORA-00942 table or view does not exist


方法二:
grant select,insert,update,delete on schema2.tablename to schema1;

在package中,使用
select column1 into var1 from schema2.tablename;
编译通过

这个是什么原因造成的?高手给解答一下,不胜感激!
我也来说两句 查看全部回复

最新回复

  • genomics (2008-8-29 16:41:17)

    在存储过程中需要查询和操作其他schema中的表时,不能通过角色授权,只能直接授权。