title: Stored procedure. RefCursor declaration issue
body: <p>I'm trying to write a stored procedure, where I use a refcursor, but when I try to run it, Oracle tells me that the refcursor is not declared</p>
  
  <p>Package:</p>
  
  <pre><code>create or replace package types
  as
  type cursorType is ref cursor;
  end;
  /
  </code></pre>
  
  <p>Procedure:</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE p_lista_veic_aluguer (
     ESCRITORIO IN INT,
     CATEGORIA  IN CHAR,
     DATA_INI   IN DATE,
     DATA_FIM   IN DATE,
     RETVAL     IN OUT types.cursorType 
  ) is
  BEGIN
    open retval for
      SELECT B.COD_Veiculo,B.Marca 
        FROM VEICULO B
        LEFT JOIN ALUGUER A 
          ON A.COD_VEICULO = B.COD_VEICULO
         AND (data_ini BETWEEN A.DATA_LEVANTAMENTO AND A.DATA_ENTREGA
          OR  data_fim BETWEEN A.DATA_LEVANTAMENTO AND A.DATA_ENTREGA)
       WHERE A.COD_VEICULO IS NULL 
         AND B.DATA_MANUTENCAO IS NULL
         AND B.CATEGORIA = categoria
       ORDER BY f_menor_dist(B.ESCRITORIO_ATUAL,escritorio) ASC;
  END p_lista_veic_aluguer;
  /
  </code></pre>
  
  <p>Testing :</p>
  
  <pre><code>SET DEFINE OFF;;
  DECLARE
    ESCRITORIO NUMBER;
    CATEGORIA  CHAR(200);
    DATA_INI   DATE;
    DATA_FIM   DATE;
    variable RETVAL TYPES.cursorType;
  BEGIN
    ESCRITORIO := 22;
    CATEGORIA  := 'A';
    DATA_INI   := '2012/11/23';
    DATA_FIM   := '2012/11/30';
    P_LISTA_VEIC_ALUGUER( ESCRITORIO =&gt; ESCRITORIO, 
                          CATEGORIA  =&gt; CATEGORIA, 
                          DATA_INI   =&gt; DATA_INI, 
                          DATA_FIM   =&gt; DATA_FIM, 
                          RETVAL     =&gt; RETVAL );
    /* Legacy output:
    DBMS_OUTPUT.PUT_LINE('RETVAL = ' || RETVAL);
    */
    print retval;
  END;
  </code></pre>
  
  <p>Error: </p>
  
  <blockquote>
    <p>Error report: ORA-06550: linha 6, coluna 19: PLS-00103: Encountered
    the symbol "TYPES" when expecting one of the following:</p>
    
    <p>:= . ( @ % ; not null range default character The symbol ":=" was
    substituted for "TYPES" to continue. ORA-06550: linha 16, coluna 9:
    PLS-00103: Encountered the symbol "RETVAL" when expecting one of the
    following:</p>
    
    <p>:= . ( @ % ; The symbol ":=" was substituted for "RETVAL" to
    continue.
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:</p>
  </blockquote>
  
  <p></p>