ID:               31222
 Updated by:       [EMAIL PROTECTED]
 Reported By:      amonw at hotmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         OCI8 related
 Operating System: redhat linux 7.2
 PHP Version:      4.3.10
 New Comment:

I can't reproduce it with any of PHP versions and Oracle 9.2. 
Did you try to run this code using PHP-CLI? 
Does it work for you?


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

[2004-12-21 08:31:53] amonw at hotmail dot com

Description:
------------
ocicommit not working in the following code when connected to oracle
8.1.7 .
The oddest thing is I can avoid this by doing any one of the
following:
1. don't use the user defined function "query", and used it's content
to replace the function calls
or 
2. use different veriable name for the two connections
or
3. use different veriable name for the two query results
or
4. add $statement=anything or unset($statement) before the second
"$statement=query($c,$sql)"

configure command(from phpinfo()):
'./configure' '--with-apxs' '--with-gd' '--with-oci8=shared'
'--with-zlib' '--with-jpeg-dir' '--enable-gd-native-ttf'
'--with-freetype-dir' '--with-ttf' '--enable-ftp' 

Reproduce code:
---------------
<?php
function query($conn,$sqlstr)
{
        $statement=ociparse($conn,$sqlstr);
        ociexecute($statement,OCI_DEFAULT);
        return $statement;
} 
dl('oci8.so');
$c=ocilogon('user','pwd');      
$sql="select sysdate from dual";
$statement=query($c,$sql);
$c=ocilogon('user','pwd');
$sql="delete from info_user where device_number='1234567890'";
$statement=query($c,$sql);
if(!ocicommit($c))
{
       $error = OCIError($c); 
       echo 'Commit failed. Oracle reports: ' . $error['message']; 
}
print("$sql :".ocirowcount($statement).' records updated.');
?>

Expected result:
----------------
Prints out "delete from info_user where device_number='1234567890' :x
records deleted" and
all records with device_number='1234567890' should be deleted.

Actual result:
--------------
Prints out "delete from info_user where device_number='1234567890' :x
records deleted" but no records was deleted.


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


-- 
Edit this bug report at http://bugs.php.net/?id=31222&edit=1

Reply via email to