title: oci_execute(): ORA-06550: PLS-00306: wrong number or types of arguments
body: <p>I have used the below code to execute an oracle stored procedure using php.</p>
  
  <pre><code>$s = oci_parse($db, 'begin :bind2 := XXXXXXXXX(:bind1); end;');
  
  if(!$s)
  {
      echo "wrong"; 
  }
  else
  {
      echo "Right";
      $in_var = 'XXXXXXX';
      $in = oci_bind_by_name($s, ':bind1', $in_var);
  
      if(!$in)
      {
          echo "Incorrect in";
      }
      else
      {
          echo "Correct in";
          $cursor = oci_new_cursor($db);
          // On your code add the latest parameter to bind the cursor resource to the Oracle argument
          $k = oci_bind_by_name($s,':bind2', $cursor, -1, OCI_B_CURSOR);
          if(!$k)
          {
              echo "Wrong";
          }
          else
          {
              echo "Correct";
              // Execute the statement as in your first try
              $execute = oci_execute($s) or die ("Unable to execute query\n");
              if(!$execute)
              {
                  echo "false";
              }
              else
              {
                  echo "correct";
                  // and now, execute the cursor
                  $result = oci_execute($cursor,OCI_DEFAULT);
                  echo $result;
                  //oci_bind_by_name($s, ":bind2", $out_var, 20); // 20 is the return length
                  //oci_execute($s,OCI_DEFAULT);
                  //echo "Procedure returned value: " . $out_var;
  
                  // Logoff from Oracle...
                  oci_free_statement($s);
                  oci_close($db);
              }
          }
      }
  }
  </code></pre>
  
  <p>I am getting the below error once executed the above code snippet.</p>
  
  <blockquote>
    <p>"oci_execute(): ORA-06550: line 1, column 7: PLS-00306: wrong number
    or types of arguments in call to 'XXXXXXXXX' ORA-06550: line 1, column
    7: PL/SQL: Statement ignored in
    /opt/lampp/htdocs/usermanagemet/callOraProc.php on line 79 Unable to
    execute query"</p>
  </blockquote>
  
  <p>My procedure is:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION XXXXXXXXX(
      username IN VARCHAR2)
    RETURN VARCHAR2
  AS
    v_query VARCHAR2( 100);
    v_out   VARCHAR2(20);
  BEGIN
    v_query := 'ALTER USER '|| username ||
      ' ACCOUNT LOCK
      PROFILE GNVLOCK';
  
    --dbms_output.put_line(v_query);
    EXECUTE immediate v_query;
    RETURN 'true';
  EXCEPTION
  WHEN OTHERS THEN
    RETURN SQLCODE;
  END SLT_GNVUSER_DISABLE;
  </code></pre>
  
  <p>Does anyone know what am I missing here?</p>