表或​​视图不存在

表或​​视图不存在

本文介绍了Bypass“表或视图不存在”在包编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Oracle数据库中有两个模式。



MYSCHEMA >

OTHERSCHEMA 不受我控制。



知道我可以从 select * from OTHERSCHEMA.OTHEROBJECT 获得结果。但是 OTHEROBJECT 是一个同义词



 插入到MYSCHEMA.MYTABLE(COL1)中,从OTHERSCHEMA.OTHEROBJECT中选择COL1; 

但它给了我表或视图不存在。



如何解决或绕过这个问题?感谢!

解决方案

我假设您获得了 otherschema.otherobject grant all on otherschema.batheme to myschema ),通过 如果是这种情况,则此角色中的权限不会用于确定在PL / SQL块中具有什么权限。



另请参见(Oracle Docu,其中在使用Definer权限的命名块中使用的角色下:


There are two schemas in a Oracle database.

MYSCHEMA that is controlled by me.

OTHERSCHEMA that is not controlled by me.

I just know I can get result from select * from OTHERSCHEMA.OTHEROBJECT. However, OTHEROBJECT is a synonym.

In my package, I have a statement like

insert into MYSCHEMA.MYTABLE(COL1) select COL1 from OTHERSCHEMA.OTHEROBJECT;

But it gave me Table or view does not exist.

How can I solve or bypass this problem? Thanks!

解决方案

I assume you received the privilege to select from otherschema.otherobject by means of a role as opposted to a direct grant (such as grant all on otherschema.otherobject to myschema). If this is the case, the privileges within this role will not be used to determine what rights you have within a PL/SQL block.

See also How Roles Work in PL/SQL Blocks (Oracle Docu, where it says under Roles Used in Named Blocks with Definer's Rights:

这篇关于Bypass“表或视图不存在”在包编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 03:05