#47189 [Opn->Csd]: oci_fetch_all() returns empty arrays on subsequent call on a given statement

From: Date: Fri, 20 Nov 2009 10:45:13 +0000
Subject: #47189 [Opn->Csd]: oci_fetch_all() returns empty arrays on subsequent call on a given statement
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-3266@lists.php.net to get a copy of this message
 ID:               47189
 Updated by:       vrana@php.net
 Reported By:      pcdinh at gmail dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: Windows XP SP2
 PHP Version:      5.3.0alpha3
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.




Previous Comments:
------------------------------------------------------------------------

[2009-11-20 10:45:12] svn@php.net

Automatic comment from SVN on behalf of vrana
Revision: http://svn.php.net/viewvc/?view=revision&revision=291058
Log: Call once (bug #47189)

------------------------------------------------------------------------

[2009-01-23 00:38:51] sixd@php.net

It is expected that oci_fetch_all() can only be used once.  It fetches
all requested rows from the DB and closes the query. Even with $maxrows
>= 1 it cannot be called multiple times after an oci_execute() to get
"pages" of rows.

------------------------------------------------------------------------

[2009-01-22 07:46:57] pcdinh at gmail dot com

Description:
------------
I don't know if it is a documentation problem or OCI8-related bug. I 
find that oci_fetch_all() always returns empty arrays on subsequent 
calls on the same statement handler. PHP Manual does not say anything 
about it.

Reproduce code:
---------------
<?php
include_once './dbconfig.php'; // $config is defined here

$connection = oci_connect($config['dbuser'], $config['dbpassword'],
$config['db']);

$stmt       = oci_parse($connection, "SELECT 1 FROM dual WHERE 1 =
:value");

$i = 1;
oci_bind_by_name($stmt, ':value', $i, -1, SQLT_INT);
oci_execute($stmt);
oci_fetch_all($stmt, $rs, 0, -1, OCI_FETCHSTATEMENT_BY_ROW);
var_dump($rs).'<br />'; // full-data array
oci_fetch_all($stmt, $rs1, 0, -1, OCI_FETCHSTATEMENT_BY_ROW);
var_dump($rs1); // empty array

oci_free_statement($stmt);
oci_close($connection);
?>

Expected result:
----------------
If it is OCI8-related bug, oci_fetch_all should return the same data 
array on multiple calls.

If it is an undocumented behavior, could you please add a 
note about it in PHP Manual ?

Actual result:
--------------
oci_fetch_all() always returns empty arrays on subsequent calls on 
the same statement handler


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47189&edit=1



Thread (2 messages)

« previous php.doc.bugs (#3266) next »