story of usual suspects ....
culprit: SELECT privilege granted through role
Resolution: Grant SELECT privilege as schema owner TO the procedure owner directly.
Raj
--------------------------------------------------------------------------------
Rajendra dot Jamadagni at nospamespn dot com
All Views expressed in this email are strictly personal.
QOTD: Any clod can have facts, having an opinion is an art !
-----Original Message-----
From: Paul Vincent [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 12, 2003 7:59 AM
To: Multiple recipients of list ORACLE-L
Subject: Referencing other schemas' tables in PL/SQL procedure
Hi,
one of our developers is having a problem. His userid has the DBA role on a test database, and he's written a PL/SQL procedure, in his schema, which is referencing (via SELECT) and updating a table in another schema, so he's coding the select as:
CURSOR c1
IS
select distinct ORIG_MODULE
from QLDBA.GENTRAN
where TRANS_DT = to_date('15/07/2003','dd/mm/yyyy');
...however, when he tries to compile the procedure, he gets several error messages including:
Line # = 16 Column # = 11 Error Text = PLS-00201: identifier 'QLDBA.GENTRAN' must be declared
Now, the table GENTRAN certainly exists in the QLDBA schema, so there must be some rule being broken here. I thought anyone with the DBA role could do any DML on any table in any schema? Indeed, when the guy runs the select in a SQL*Plus window, it works fine, so can any PL/SQL guru shed some light on this? My PL/SQL skills are pretty rudimentary, and a rummage through the PL/SQL User Guide didn't turn anything up...
Hope someone can help!
Regards,
Paul
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Paul Vincent
INET: [EMAIL PROTECTED]
Fat City Network Services -- 858-538-5051 http://www.fatcity.com
San Diego, California -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
********************************************************************This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.*********************************************************************2