简体   繁体   中英

Oracle PLS-00201 error in procedure across users

I have an oracle database shared by both an internal application and our website.

I know very little about oracle so will explain things how I understand it..

The database has two users APPUSER and WEBUSER when logged in (using Oracle SQL Developer) as APPUSER you can see all the tables in the database. When logged in as WEBUSER you cannot see anything but a couple of procedures, the APPUSER cannot see these procedures.

One procedure starts with:

create or replace PROCEDURE "UPDATE_DETAIL" 
(v_ref IN APPUSER.DETAILS.REFERENCE%TYPE
,v_desc IN APPUSER.DETAILS.DESCRIPTION%TYPE
...

Line 2 has a red squiggly with "PLS-00201: identifier APPUSER is not declared"

I believe it has the "APPUSER.TABLE.COLUMN" because WEBUSER does not have direct access to the tables.

I have executed GRANT ALL ON UPDATE_DETAIL TO APPUSER logged in as WEBUSER, but that did not fix the issue, WEBUSER is the owner of the procedure, but does not have anything listed in the Grants list (I assume because owner just has the rights be default?)

The Dependencies list for the procedure is also empty, but cannot find how to manually add one to it.

Not sure what else to try to fix this error.

Thanks.

If you want a procedure owned by WEBUSER (and I believe from your description that UPDATE_DETAIL is owned by WEBUSER ) to reference objects owned by APPUSER , you would need to grant WEBUSER privileges on those objects. For example, as APPUSER

GRANT SELECT ON appuser.details
   TO webuser;

This assumes that WEBUSER only needs to SELECT from the APPUSER.DETAILS table. If your procedure needs to INSERT , UPDATE , or DELETE data in that table, then WEBUSER would need to be granted additional privileges on the APPUSER.DETAILS table. You'd need to make similar grants for every table in APPUSER that the WEBUSER user needs to reference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM