php.net |  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
Votes:1
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-11-13 13:00 UTC] james_blond at hipernet dot brda dot net
Description:
------------
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_execute($s,OCI_COMMIT_ON_SUCCESS);
oci_fetch_all($s,$Row,0,10, OCI_NUM); 
print_r($Row);
oci_fetch_all($s,$Row,10,10, OCI_NUM);// here return error ORA-01002
print_r($Row);

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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-19 00:18 UTC] sixd@php.net
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] sixd@php.net
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] sixd@php.net
Until array functionality is introduced, make sure that oci8.default_prefetch is set high in such cases.
 [2010-01-06 19:39 UTC] sixd@php.net
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: Tue Mar 19 08:01:29 2024 UTC