title: oracle "table or view does not exist" from inside stored procedure
body: <p>the scenarion is like this... </p>
  
  <p>I HAVE a namespace <code>XXX</code> where I created some tables and some stored procedures...</p>
  
  <p>THEY HAVE a namespace <code>YYY</code> where they created some tables...</p>
  
  <p>THEY GRANTED <code>XXX</code> access to their tables, so when I conect to SQL Developer using <code>XXX</code> connection, I can do: </p>
  
  <pre><code>SELECT * FROM YYY.TableA
  </code></pre>
  
  <p>But if I try to run that very same statement from inside a stored procedure (either simple stored procedure or a package), the stored procedure does not compile. It happens to a lot of sp's. Is there any other permission that I have to ask for??? I'm running sp's like this:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE PRC_SOMESP(
  ) AS BEGIN
  END PRC_SOMESP;
  </code></pre>
  
  <p>Procedures that does not access YYY tables do compile well.</p>
  
  <p>Thanks in advance.  </p>
  
  <p>After Justin Cave response, I'm trying to add "AUTHID CURRENT_USER" sentence to the sp's but getting the same "table or view does not exist" result:  </p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE PRC_PROC1( PARAMETERS... )  
  AUTHID CURRENT_USER  
  AS  
      MYVAR NUMBER;  
  BEGIN  
      STATEMENTS...
  END PRC_PROC1;  
  
  CREATE OR REPLACE PACKAGE PKG_PROC2  
  AUTHID CURRENT_USER  
  AS  
  TYPE T_CURSOR IS REF CURSOR;
  PROCEDURE PRC_PROC2( PARAMETERS... )  
  END PKG_PROC2  
  </code></pre>
  
  <p>Should I check anything else???</p>