title: Oracle Package Body Compile Errors: SQL Statement Ignored, table or view does not exist
body: <p>I need to wrap a SQL script I wrote into a package because... work.</p>
  
  <p>I get really lost in PL/SQL, and have no idea what I'm doing wrong:</p>
  
  <pre><code>    CREATE OR REPLACE PACKAGE F_LOG_ARCHIVE_PKG AS 
        PROCEDURE LOG_ARCHIVE;
      END F_LOG_ARCHIVE_PKG;
  
      /************************ F_BUSINESS_IDENTIFIER ********************************/
      /
      CREATE OR REPLACE PACKAGE BODY F_LOG_ARCHIVE_PKG AS
      PROCEDURE LOG_ARCHIVE IS
      BEGIN
          INSERT INTO LOGARC.F_BUSINESS_IDENTIFIER ("ID", 
            "SERVICE_ID",
            "OPERATION_ID",
            "BUSINESS_IDENTIFIER_NAME",
            "BUSINESS_IDENTIFIER_VALUE",
            "EXCEPTION_ROW_ID",
            "ARCHIVE_DATE")
          SELECT DISTINCT ORIGINAL."ID", 
            ORIGINAL.SERVICE_ID,
            ORIGINAL.OPERATION_ID,
            ORIGINAL.BUSINESS_IDENTIFIER_NAME,
            ORIGINAL.BUSINESS_IDENTIFIER_VALUE,
            ORIGINAL.EXCEPTION_ROW_ID,
            sysdate
          FROM LOGUSR.F_BUSINESS_IDENTIFIER ORIGINAL
          --Latest exception date based on service id and operation id
          INNER JOIN (SELECT F_EXCEPTION.SERVICE_ID,
                    F_SERVICE_OPERATION_NAME.ID AS OPERATION_ID,
                    MAX(RECORD_CREATED_DATE) AS RECORD_CREATED_DATE, 
                    MAX(EXCEPTION_DATE) AS EXCEPTION_DATE
                    FROM LOGUSR.F_EXCEPTION
                    INNER JOIN LOGUSR.F_SERVICE_OPERATION_NAME
                    ON F_EXCEPTION.OPERATION_NAME = F_SERVICE_OPERATION_NAME.OPERATION_NAME
                    GROUP BY F_EXCEPTION.SERVICE_ID,F_SERVICE_OPERATION_NAME.ID) EXCEPTION_DATE
            ON ORIGINAL.SERVICE_ID = EXCEPTION_DATE.SERVICE_ID
            AND ORIGINAL.OPERATION_ID = EXCEPTION_DATE.OPERATION_ID
          --Service name to join to F_SERVICE_LOGSTATUS table
          INNER JOIN LOGUSR.F_SERVICE_NAME
            ON ORIGINAL.SERVICE_ID = F_SERVICE_NAME.ID
          --Operation name to join to F_SERVICE_LOGSTATUS table
          INNER JOIN LOGUSR.F_SERVICE_OPERATION_NAME
            ON ORIGINAL.OPERATION_ID = F_SERVICE_OPERATION_NAME.ID
          --Archive strategy
          INNER JOIN LOGUSR.F_SERVICE_LOGSTATUS
            ON F_SERVICE_NAME.SERVICE_NAME = F_SERVICE_LOGSTATUS.SERVICE_NAME
            AND F_SERVICE_OPERATION_NAME.OPERATION_NAME = F_SERVICE_LOGSTATUS.OPERATION_NAME
          WHERE F_SERVICE_LOGSTATUS.ARCHIVE_FLAG = 'Y'
          AND F_SERVICE_LOGSTATUS.ARCHIVE_DAYS &lt;= (sysdate-EXCEPTION_DATE.EXCEPTION_DATE);
  </code></pre>
  
  <p>SNIP</p>
  
  <pre><code>    END LOG_ARCHIVE; 
      END F_LOG_ARCHIVE_PKG;
  </code></pre>
  
  <p>Errors returned:</p>
  
  <p>Error(4,5): PL/SQL: SQL Statement ignored
  Error(4,24): PL/SQL: ORA-00942: table or view does not exist</p>
  
  <p>The DBA recently updated to role to give the user write access to both schemas.</p>