title: Errors in oracle stored procedure
body: <p>I'm having problems while executing a stored procedure in Oracle.</p>
  
  <p>Below is the stored procedure:</p>
  
  <pre><code>CREATE OR REPLACE Procedure xxxlist
      (yyyid in NUMBER)    
  IS
      xid number(6);
      cursor c1 is select distinct xxxID from MXS.Y where YID=yyyid;
  BEGIN
  IF NOT c1%ISOPEN THEN 
      OPEN c1;
  END IF;
  LOOP
      FETCH c1 into xid;
      dbms_output.put_line(TO_CHAR(xid));
      EXIT WHEN c1%NOTFOUND; 
  END LOOP;
  CLOSE c1;   
  END;
  </code></pre>
  
  <p>When I create the stored procedure, I get the following error:</p>
  
  <pre><code>Warning: Procedure created with compilation errors.
  </code></pre>
  
  <p>I execute the below command to provide me more details on the above abstract error message.</p>
  
  <pre><code>SHO ERR;
  </code></pre>
  
  <p>I get the below details in response to the above command:</p>
  
  <pre><code>Errors for PROCEDURE XXXLIST:
  LINE/COL ERROR
  -------- -----------------------------------------------------------------
  5/18     PL/SQL: SQL Statement ignored
  5/52     PL/SQL: ORA-00942: table or view does not exist
  </code></pre>
  
  <p>Now, I understand that there is a problem with the table name or sql query itself. So, I try to execute the SQL query alone, seperately, outside the PRODECURE, to see what is wring with the table or query.</p>
  
  <pre><code>select distinct xxxID from MXS.Y where YID=yyyid;
  </code></pre>
  
  <p>But, I do not find any issues with the above query. The query runs fine and I get proper result.</p>
  
  <p>So, I do not know why the procedure is having problems while executing. Can anyone help?</p>