當前oracle的登錄用戶爲A,創建以下存儲過程:
create or replace procedure myproc as
begin
insert into B.object values(...);
commit;
end;
此時會報錯:
Error: PL/SQL: ORA-00942: table or view does not exist
原因:
A用戶沒有權限操作B用戶下的表,需要在B用戶下顯示地給A用戶授權!
用B用戶登錄,執行以下操作:
GRANT ALL ON object TO A;