php man page for oci_new_cursor

Query: oci_new_cursor

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

OCI_NEW_CURSOR(3)														 OCI_NEW_CURSOR(3)

oci_new_cursor - Allocates and returns a new cursor (statement handle)

SYNOPSIS
resource oci_new_cursor (resource $connection)
DESCRIPTION
Allocates a new statement handle on the specified connection.
PARAMETERS
o $connection - An Oracle connection identifier, returned by oci_connect(3) or oci_pconnect(3).
RETURN VALUES
Returns a new statement handle, or FALSE on error.
EXAMPLES
Example #1 Binding a REF CURSOR in an Oracle stored procedure call <?php // Precreate: // create or replace procedure myproc(myrc out sys_refcursor) as // begin // open myrc for select first_name from employees; // end; $conn = oci_connect("hr", "hrpwd", "localhost/XE"); if (!$conn) { $m = oci_error(); trigger_error(htmlentities($m['message']), E_USER_ERROR); } $curs = oci_new_cursor($conn); $stid = oci_parse($conn, "begin myproc(:cursbv); end;"); oci_bind_by_name($stid, ":cursbv", $curs, -1, OCI_B_CURSOR); oci_execute($stid); oci_execute($curs); // Execute the REF CURSOR like a normal statement id while (($row = oci_fetch_array($curs, OCI_ASSOC+OCI_RETURN_NULLS)) != false) { echo $row['FIRST_NAME'] . "<br /> "; } oci_free_statement($stid); oci_free_statement($curs); oci_close($conn); ?>
NOTES
Note In PHP versions before 5.0.0 you must use ocinewcursor(3) instead. This name still can be used, it was left as alias of oci_new_cursor(3) for downwards compatability. This, however, is deprecated and not recommended. PHP Documentation Group OCI_NEW_CURSOR(3)
Related Man Pages
oci_fetch(3) - php
oci_fetch_row(3) - php
oci_field_type_raw(3) - php
oci_num_fields(3) - php
oci_parse(3) - php
Similar Topics in the Unix Linux Community
Exit Code in HP-UX KSH.
piping oracle output to a file?
Need help with procedure and parameters in a script