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

Thanks for your trying and reply.
I tried php-cli and it print the same result plus a new line with some
blanks and no records was deleted either.
And I tried php 4.2.2 on the other machine connected to oracle
8.1.7,php 4.3.10 connected to oracle 9.2.0.1.0,php 4.2.2 connected to
oracle 9.2.0.1.0. They all produced the same result. Except that when I
used php-cli 4.2.2, it also printed "Segmentation fault" at the end.
Are you sure you used exactly the same code as I quoted? 
As I mentioned, even some minor changes which seem not relevant may
affect the result.
Thank you again for your quick response.


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

[2004-12-21 10:48:21] [EMAIL PROTECTED]

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?

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

[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