我正在使用oracle 19 c.我运行一个删除与功能在另一个架构,我得到错误
create user USER1 identified by USER1;
create user USER2 identified by USER2;
create user USER3 identified by USER3;
grant connect to USER1;
grant connect to USER2;
grant connect to USER3;
grant unlimited tablespace to USER1;
grant unlimited tablespace to USER2;
grant unlimited tablespace to USER3;
grant create procedure to USER1;
grant create table to USER1;
grant create view to USER2;
CREATE OR REPLACE PACKAGE USER1.PKG1 IS
FUNCTION FUNC1(p_DTE DATE) RETURN VARCHAR2;
END PKG1;
/
CREATE OR REPLACE PACKAGE BODY USER1.PKG1 IS
FUNCTION FUNC1(p_DTE DATE) RETURN VARCHAR2 IS
BEGIN
RETURN NULL;
END;
END PKG1;
/
GRANT ALL ON USER1.PKG1 TO USER2 WITH GRANT OPTION;
GRANT EXECUTE ON USER1.PKG1 TO USER3;
create table USER1.TAB1( str1 varchar2(100), num1 number, dte1 DATE)
/
insert into USER1.TAB1 (STR1, NUM1, DTE1)values ('S1', 1, SYSDATE);
insert into USER1.TAB1 (STR1, NUM1, DTE1)values ('S2', 2, SYSDATE-1);
COMMIT;
/
GRANT ALL ON USER1.TAB1 TO USER2 WITH GRANT OPTION;
/
CREATE OR REPLACE VIEW USER2.VIW1 AS SELECT * FROM USER1.TAB1
/
GRANT SELECT,INSERT,UPDATE,DELETE ON USER2.VIW1 TO USER3;
字符串
后创建环境
使用低于代码的用户3登录时出现错误:ORA-01732:此视图上的数据操作不法律的
DELETE USER2.VIW1 WHERE USER1.PKG1.FUNC1(DTE1)='0';
型
使用以下代码的用户2登录成功运行。
DELETE USER2.VIW1 WHERE USER1.PKG1.FUNC1(DTE1)='0';
型
1条答案
按热度按时间eufgjt7s1#
从docs:
不确定,但是否USER 3在表USER1.TAB1!上没有特权?
在你的代码中有
字符串
.关于基表USER1.TAB1,没有向USER 3授予任何权限-而只是向视图授予权限。是否尝试添加
型
如果这没有帮助,那么它可能是因为使用了函数here。where条件被设置在从函数或表达式派生的虚拟列上,那么视图只能被查询。