title: How to execute a stored procedure with cursor and table OUT parameters through SQL Developer?
body: <p>I’m having trouble testing, in SQL Developer 3.2.20.09, an Oracle stored procedure that contains 2 specificities:</p>
  
  <ul>
  <li>a user defined "cursor type" output parameter</li>
  <li>a user defined "TABLE OF VARCHAR type" output parameter.</li>
  </ul>
  
  <p>Stored procedure signature:</p>
  
  <pre><code>TYPE ref_cursor_tst IS REF CURSOR;
  TYPE arrWarningCode_tst IS TABLE OF VARCHAR2 (4000)
  INDEX BY BINARY_INTEGER;
  
  PROCEDURE SP_ITF_CU_DOCUMENT_Test (
  p_projectNumber IN VARCHAR2,
  p_tag IN VARCHAR2,
  p_title IN VARCHAR2,
  out_document_curs OUT ref_cursor_tst,
  out_errorCode OUT VARCHAR2,
  out_arrWarningCode OUT arrWarningCode_tst);
  </code></pre>
  
  <p>My actual best test code I could end up with:</p>
  
  <pre><code>set serveroutput on size 100000
  
  DECLARE
       docRef               VARCHAR2(200);
       outDocCurs           PD360BADMIN.PKG_ITF_GENERAL_TST.ref_cursor_tst;
       outErrorCode         VARCHAR2(2000);
       arrWarningCodes      PD360BADMIN.PKG_ITF_GENERAL_TST.arrWarningCode_tst;
       i                    PLS_INTEGER;
       doc                  TBL_OBJECT%ROWTYPE;
  
  BEGIN
       dbms_output.put_line('debut de procedure');
  
       docRef:= 'DOC-012';
       arrWarningCodes.DELETE;
  
       --call SP
       PKG_ITF_GENERAL_TST.SP_ITF_CU_DOCUMENT_TEST (
        p_projectNumber    =&gt; 'XXX', 
        p_tag              =&gt; docRef, 
        p_title            =&gt; 'Doc title', 
        out_document_curs  =&gt; outDocCurs, 
        out_errorCode      =&gt; outErrorCode,
        out_arrWarningCode =&gt; arrWarningCodes);
  
       --print error code 
       dbms_output.put_line('out_errorCode=' || outErrorCode);
  
       --print output cursor
       --dbms_output.put_line(outDocCurs);
       LOOP
         FETCH outDocCurs INTO doc;
         EXIT WHEN outDocCurs%NOTFOUND;
         dbms_output.put_line(doc.OBJ_ID||','||doc.OBJ_TAG);
       END LOOP;
  
       --print warnings array     
       IF  arrWarningCodes.count &gt; 0 THEN
            FOR i IN arrWarningCodes.FIRST .. arrWarningCodes.LAST LOOP
                  dbms_output.put_line('warning code=' || arrWarningCodes(i) );
            END LOOP; 
       ENd IF;
  
       dbms_output.put_line('fin de procedure');
  END;
  /
  </code></pre>
  
  <p>The error I get:</p>
  
  <pre><code>Error report:
  ORA-06504: PL/SQL: Return types of Result Set variables or query do not match
  ORA-06512: at line 30
  06504. 00000 -  "PL/SQL: Return types of Result Set variables or query do not match"
  *Cause:    Number and/or types of columns in a query does not match declared
             return type of a result set  variable, or declared types of two Result
             Set variables do not match.
  *Action:   Change the program statement or declaration. Verify what query the variable
             actually refers to during execution.
  debut de procedure
  out_errorCode=
  </code></pre>
  
  <p>I've been testing various solutions and syntaxes for days as well as digging the net and requiring help from different sources with no success.</p>
  
  <p>Any clue would be much appreciated.</p>