oci_new_cursor     (PHP 5)
oci_new_cursor -- Allocates and returns a new cursor (statement handle)
Description resource 
oci_new_cursor  ( resource connection )
     oci_new_cursor()  allocates a new statement handle on
     the specified connection.
    
     
Example 1. Using REF CURSOR in an Oracle's stored procedure 
<?php    // suppose your stored procedure info.output returns a ref cursor in :data $conn  =  oci_connect ( "scott" ,  "tiger" ); $curs  =  oci_new_cursor ( $conn ); $stmt  =  oci_parse ( $conn ,  "begin info.output(:data); end;" ); oci_bind_by_name ( $stmt ,  "data" ,  $curs , - 1 ,  OCI_B_CURSOR ); oci_execute ( $stmt ); oci_execute ( $curs ); $data  =  oci_fetch_row ( $curs )) { var_dump ( $data ); oci_free_statement ( $stmt ); oci_free_statement ( $curs ); oci_close ( $conn ); ?> 
 
    
     
Example 2. Using REF CURSOR in an Oracle's select statement 
<?php    echo  "<html><body>" ; $conn  =  oci_connect ( "scott" ,  "tiger" ); $count_cursor  =  "CURSOR(select count(empno) num_emps from emp "  . "where emp.deptno = dept.deptno) as EMPCNT from dept" ; $stmt  =  oci_parse ( $conn ,  "select deptno,dname,$count_cursor" ); oci_execute ( $stmt ); "<table border=\"1\">" ; "<tr>" ; "<th>DEPT NAME</th>" ; "<th>DEPT #</th>" ; "<th># EMPLOYEES</th>" ; "</tr>" ; $data  =  oci_fetch_assoc ( $stmt )) { "<tr>" ; $dname   =  $data [ "DNAME" ]; $deptno  =  $data [ "DEPTNO" ]; "<td>$dname</td>" ; "<td>$deptno</td>" ; oci_execute ( $data [ "EMPCNT" ]); $subdata  =  oci_fetch_assoc ( $data [ "EMPCNT" ])) { $num_emps  =  $subdata [ "NUM_EMPS" ]; "<td>$num_emps</td>" ; "</tr>" ; "</table>" ; "</body></html>" ; oci_free_statement ( $stmt ); oci_close ( $conn ); ?> 
 
    
     oci_new_cursor()  returns FALSE 
Note:  
      In PHP versions before 5.0.0 you must use ocinewcursor() oci_new_cursor()  for downwards compatability. 
      This, however, is deprecated and not recommended.