title: calling stored procedure from anonymous block
body: <p>I have problem reading result from plsql stored procedure written in sql developer on Oracle 11gr2 database on local machine.</p>
  
  <p>This is my table:</p>
  
  <pre><code>create table MY_TEST_TABLE
  (employee_id    NUMBER(6)
  ,first_name     VARCHAR2(20)
  ,last_name      VARCHAR2(25) 
  ,email          VARCHAR2(25) 
  ,phone_number   VARCHAR2(20));
  </code></pre>
  
  <p>This is procedure declaration:</p>
  
  <pre><code>create or replace PACKAGE TEST_PACKAGE AS 
  procedure test_procedure (i_id in number,
                            o_data out sys_refcursor);
  END TEST_PACKAGE;
  </code></pre>
  
  <p>This is body:</p>
  
  <pre><code>create or replace PACKAGE BODY TEST_PACKAGE AS
    procedure test_procedure (i_id in number,
                          o_data out sys_refcursor) AS
    BEGIN
      open o_data for
        select  employee_id,
            first_name,
            last_name,
            email,
            phone_number
        from my_test_table
        where EMPLOYEE_ID = i_id;     
      close o_data;
    END test_procedure;
  END TEST_PACKAGE;
  </code></pre>
  
  <p>And this is anonymous block call:</p>
  
  <pre><code>SET serveroutput on
  DECLARE
    in_id number; 
    my_cursor sys_refcursor;
    current_record my_test_table%ROWTYPE;
  BEGIN
    in_id := 1;
    test_package.test_procedure(in_id, my_cursor);
    open my_cursor;
    LOOP
      FETCH my_cursor INTO current_record;
        EXIT WHEN my_cursor%NOTFOUND;
      dbms_output.put_line(' - out - ' || current_record.employee_id);
    END LOOP;
  END;
  </code></pre>
  
  <p>I am getting error:</p>
  
  <pre><code>Error starting at line : 2 in command -
  DECLARE
    in_id number; 
    my_cursor sys_refcursor;
    current_record my_test_table%ROWTYPE;
  BEGIN
    in_id := 1;
    test_package.test_procedure(in_id, my_cursor);
    open my_cursor;
    LOOP
      FETCH my_cursor INTO current_record;
        EXIT WHEN my_cursor%NOTFOUND;
      dbms_output.put_line(' - out - ' || current_record.employee_id);
    END LOOP;
  END;
  Error report -
  ORA-06550: line 8, column 5:
  PLS-00382: expression is of wrong type
  ORA-06550: line 8, column 5:
  PL/SQL: SQL Statement ignored
  06550. 00000 -  "line %s, column %s:\n%s"
  *Cause:    Usually a PL/SQL compilation error.
  *Action:
  </code></pre>
  
  <p>Can someone explain what is wrong?
  Tnx!</p>