title: Calling a procedure that has a refcursor as out parameter
body: <p>I created a package as follows :</p>
  
  <pre><code>create or replace package apps.xx_sal
  as
     PROCEDURE SAL_HIST_C(p_person_id IN NUMBER
                          ,p_success   OUT VARCHAR2
                          ,p_sql   OUT VARCHAR2
                          ,p_cur   OUT SYS_REFCURSOR)
  IS
        l_success            VARCHAR2(32000) := 'OK';
        l_sql                VARCHAR2(32767);
        l_sql_empty          VARCHAR2(32767);
        l_step               VARCHAR2(1000);
        l_query_length       PLS_INTEGER := 0;
        c_process   CONSTANT VARCHAR2(200) := 'SAL_HIST_C';
     BEGIN
        l_step := c_process || ' :: BUILD EMPTY SQL';
        --
  
        l_sql_empty := ' SELECT person_id
    ,pay_basis_id
    ,change_date
  
         from apps.salary_hist_v
           WHERE 1 = 2 ';
        --
  
        --
        l_step := c_process || ' :: BUILD SQL';
        --
        l_sql      :=
           '
      SELECT paf.person_id
            ,paf.pay_basis_id
            ,ppp.change_date change_date
  
      FROM hr.per_pay_proposals ppp
          ,per_all_assignments_f paf
  
      WHERE paf.primary_flag = ''Y''
  
      AND   ppb.pay_basis_id = paf.pay_basis_id
      AND   paf.person_id = :l_person_id ';
  
        --
        -- check sql query
        l_query_length := LENGTH(l_sql);
        --DBMS_OUTPUT.put_line ('Length of EXECUTED SQL := ' || l_query_length);
  
        -- open cursor with bind variables applied
        --
        l_step := c_process || ' :: OPEN CURSOR with BIND VARIABLE APPLIED';
  
        --
        OPEN p_cur FOR l_sql USING p_person_id;
  
        l_success := 'OK';
        p_sql := l_sql;
        p_success := l_success;
     EXCEPTION
        WHEN OTHERS
        THEN
           l_success := 'ERROR :: ' || l_step || CHR(10) || SQLERRM || CHR(10) || DBMS_UTILITY.format_error_backtrace;
           p_sql := l_sql;
           p_success := l_success;
  
           OPEN p_cur FOR l_sql_empty;
     END SAL_HIST_C;
  </code></pre>
  
  <p>Now when I am passing the parameter to see the output an error occurs:</p>
  
  <pre><code>DECLARE 
   --l_person_id  number;
  
       l_success            VARCHAR2(32000) ;
        l_sql                VARCHAR2(32767);
    l_cur sys_refcursor;
  
  BEGIN 
  
    APPS.xx_sal.SAL_HIST_C (   
     person_id=&gt;4816, 
  p_success =&gt; l_success, 
  p_sql=&gt;l_sql,
  p_cur =&gt; :l_cur);
  
    COMMIT; 
    DBMS_OUTPUT.PUT_LINE ('Output Returned from Proc :: ' || l_success); 
  DBMS_OUTPUT.PUT_LINE ('SQL Executed for the GRID :: ' || l_cur); 
  END;
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>[Error] Execution (10: 3): ORA-06550: line 10, column 3:<br>
    PLS-00306: wrong number or types of arguments in call to 'SAL_HIST_C'<br>
    ORA-06550: line 10, column 3:<br>
    PL/SQL: Statement ignored<br>
    ORA-06550: line 18, column 23:<br>
    PLS-00306: wrong number or types of arguments in call to '||'<br>
    ORA-06550: line 18, column 1:<br>
    PL/SQL: Statement ignored</p>
  </blockquote>
  
  <p>I don't know why is the error happens. I am executing in Toad. I think I am not calling the procedure in the anonymous block correctly</p>