#31995 [NEW]: Oracle select

From: Date: Wed, 16 Feb 2005 09:49:56 +0000
Subject: #31995 [NEW]: Oracle select
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-74154@lists.php.net to get a copy of this message
From:             wojciech dot superson at bph dot pl
Operating system: MS Windows 2003 Serwer
PHP version:      5.0.3
PHP Bug Type:     Apache related
Bug description:  Oracle select

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 bug report at http://bugs.php.net/?id=31995&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31995&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31995&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31995&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31995&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31995&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31995&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31995&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31995&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31995&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31995&r=notwrong
Not enough info:             http://bugs.php.net/fix.php?id=31995&r=notenoughinfo
Submitted twice:             http://bugs.php.net/fix.php?id=31995&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31995&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31995&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31995&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31995&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31995&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31995&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31995&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31995&r=mysqlcfg


Thread (9 messages)

« previous php.bugs (#74154) next »