#31995 [Opn->Fbk]: Oracle select

From: Date: Fri, 18 Feb 2005 12:56:36 +0000
Subject: #31995 [Opn->Fbk]: Oracle select
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-74269@lists.php.net to get a copy of this message
 ID:               31995
 Updated by:       tony2001@php.net
 Reported By:      wojciech dot superson at bph dot pl
-Status:           Open
+Status:           Feedback
 Bug Type:         OCI8 related
 Operating System: MS Windows 2003 Serwer
 PHP Version:      5.0.3
 New Comment:

How could we reproduce it?


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

[2005-02-18 12:13:32] wojciech dot superson at bph dot pl

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.

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

[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


Thread (9 messages)

« previous php.bugs (#74269) next »