HELP ME!!!

[复制链接]
查看11 | 回复1 | 2006-4-17 13:46:34 | 显示全部楼层 |阅读模式
QUESTION:
Troubleshooting (Describe the reason why can not execute procedure? )
I have two user "pccxx" and "pccback" and one role "role_back" in my oracle databse.
First.
I grant the select table privilegs to the role "role_back" by below script.
GRANT SELECT ON PCC_ACCEPTM TO ROLE_BACKUP;
(give select PCCXX.PCC_ACCEPTM ==> "role_back" )
Second.
I grant the role "role_back" to another user "pccback" by below script.
GRANT "role_back" TO "pccback";
("role_back" ==> pccback" )
I can select pccxx.pcc_acceptm table by user "pccback";
SQL> connect pccback/pccback@luxpccdb
SQL> SELECT ACCP_NO FROM PCCXX.PCC_ACCEPTM WHERE ACCP_NO = 'W021125001';
ACCP_NO
--- ------------
W021125001
but I can not execute procedure by below script ,
oracle server return ORA-00942 table or view does not exist ,
--------------------------------------------------------------------------------
PROCEDURE pro_test
IS
query_str VARCHAR2(200);
BEGIN
query_str := 'INSERT INTO PCC_ACCEPTM_2002(FACT_NO,YYMM,ACCP_NO) SELECT ACCP_NO FROM PCCXX.PCC_ACCEPTM WHERE ACCP_NO = ''W021125001''';
EXECUTE IMMEDIATE query_str ;
COMMIT WORK ;
END;
--------------------------------------------------------------------------------
SQL> EXEC PRO_TEST
begin PRO_TEST; end;
ERROR 在行 1:
ORA-00942 table or view does not exist
ORA-06512: "BACKUP.PRO_TEST", line 6
ORA-06512: line 1
Please tell me the reason why can not execute procedure?
回复

使用道具 举报

千问 | 2006-4-17 13:46:34 | 显示全部楼层
grantSELECT ON PCC_ACCEPTM TOpccback;
存储过程中判断权限是不考虑通过角色赋予得到的。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行