ID: 31995
User updated by: wojciech dot superson at bph dot pl
Reported By: wojciech dot superson at bph dot pl
Status: Open
Bug Type: OCI8 related
Operating System: MS Windows 2003 Serwer
PHP Version: 5.0.3
New Comment:
I have one more problem, I think it is connected to the original one.
Very often, there is message in apache error.log file "PHP Warning:
oci_fetch_all() [<a
href='function.oci-fetch-all'>function.oci-fetch-all</a>]:
OCIFetchStatement: ORA-01001: invalid cursor\n in d:\\program
files\\apache group\\Apache\\htdocs\\moa\\php\\oracle.php on line 188.
The line 188 is within the OracleExecProcSelect function which I have
sent you before.
Previous Comments:
------------------------------------------------------------------------
[2005-02-16 10:49:55] wojciech dot superson at bph dot pl
Description:
------------
I use PHP 5.0.3 with Oracle 9.2.0.5.0 on HP-UX 11.11 and Apache 1.3.31.
Aplication works fine and calls the same queries (as Oracle stored
procedures) many times. The problem is that sometimes (more less once
every 30/40 times) query returns only one/two record(s) neverless there
are many records in database for this query. I am not able to reproduce
the problem on wish. I attach the source code of the function I use to
call the Oracle stored procedure for every query in the application.
The name of procedure is passed in $statement variable.
Reproduce code:
---------------
function OracleExecProcSelect( $conn,$statement,& $results, &
$errorcode=-1, & $errordesc="" )
{
$curs = oci_new_cursor( $conn );
$stmt = oci_parse( $conn,"begin ".$statement." end;");
if ( ! oci_bind_by_name( $stmt,"data",$curs,-1,OCI_B_CURSOR ) ) return
;
if ( ! oci_bind_by_name( $stmt,":error_code",$errorcode,32 ) ) return
;
if ( ! oci_bind_by_name( $stmt,":error_desc",$errordesc,255 ) ) return
;
oci_execute( $stmt,OCI_DEFAULT );
oci_execute( $curs,OCI_DEFAULT );
$nrows = oci_fetch_all( $curs,$results );
oci_free_statement($stmt);
oci_free_statement($curs);
return $nrows;
}
Expected result:
----------------
I should get the array ($results) with rows returned by the Oracle
stored procedure (its name is passed by $statement variable). It works
fine but sometimes it returns only one/two rows. Then I call this
procedure from sqlplus I get all requested records.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31995&edit=1