|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46565 oci_fetch_all() returns ORA-01002
Submitted: 2008-11-13 13:00 UTC Modified: 2010-01-06 19:39 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: james_blond at hipernet dot brda dot net Assigned: sixd (profile)
Status: Wont fix Package: OCI8 related
PHP Version: 5.2.6 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: james_blond at hipernet dot brda dot net
New email:
PHP Version: OS:


 [2008-11-13 13:00 UTC] james_blond at hipernet dot brda dot net
function oci_fetch_all on second use return error ORA-01002: fetch out of sequence.

Reproduce code:
$dbstr = "(DESCRIPTION = (ADDRESS = PROTOCOL = TCP (HOST = host)(PORT = 1521))(CONNECT_DATA = (SID = sid)))";
$c = oci_connect("user","pass",$dbstr,"UTF8");

$SQL = "SELECT * FROM table "; // table have more then 100 rec
$s = oci_parse($c,$SQL);
oci_fetch_all($s,$Row,0,10, OCI_NUM); 
oci_fetch_all($s,$Row,10,10, OCI_NUM);// here return error ORA-01002

Expected result:
printed array $Row

Actual result:
array $Row is printed only on first time 
on second $Row is empty , oci_fetch_all -> return error ORA-01002: fetch out of sequence.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-19 00:18 UTC]
The oci_fetch_all() function was designed to cancel a query after
being called once.  The behavior you see is expected.
However it sounds like a possible enhancement.
 [2008-11-20 02:16 UTC]
The use case was for a report generator, typically handling 10K rows, and sometimes up to 80K.  Batching would improve performance.
 [2009-02-11 20:19 UTC]
Until array functionality is introduced, make sure that oci8.default_prefetch is set high in such cases.
 [2010-01-06 19:39 UTC]
I'm closing this because there are no plans to break existing  
oci_fetch_all() behaviour.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 22:01:28 2024 UTC