#39147 [NEW]: Problems with OCIExecute and CLOB fields (maybe OCIBindByName)
| From: | pucheta at yahoo dot com | Date: | Fri, 13 Oct 2006 13:44:25 +0000 |
| Subject: | #39147 [NEW]: Problems with OCIExecute and CLOB fields (maybe OCIBindByName) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-103518@lists.php.net to get a copy of this message | ||
From: pucheta at yahoo dot com
Operating system: Windows Server 2003 Apache/1.3.3
PHP version: 4.4.4
PHP Bug Type: *General Issues
Bug description: Problems with OCIExecute and CLOB fields (maybe OCIBindByName)
Description:
------------
The problem is to insert or update CLOB fields in Oracle. When i use Bind
variables with OCI library, i connect, parse and bind by name ok, but
OCIExecute says that the LOB Locator is invalid. I search internet for
several days and i've not find any solution. The code is equal to the php
examles of the manual. I prove to pass the OCI-Lob object returned by
OCINewDescriptor, to the OCIBindByName by the deprecated reference format
and without reference, but the problem is the same. I suspect
OCIBindByName modify the OCI-Lob object.
-------
Modules:
oci8 and several commons like mysql, gd, pgsql, sessions, etc.
------
php.ini
error_reporting = 2047
to reporting all errors
Reproduce code:
---------------
<?php
if ( !$conn = OCILogon("user", "pass", "base") )
die "Conection failed.";
$SQL = "UPDATE table SET field = :var WHERE ID = 1";
if ( !($stat = OCIParse ( $conn, $SQL )) )
echo "OciParse failed.<br />";
$lob = OCINewDescriptor($conn, OCI_D_LOB);
OCIBindByName($stat, ':PEPE', &$lob, -1, OCI_B_CLOB);
OCIExecute($stat);
$large_text = "realy large text...";
if( $lob->save($large_text) ){
OCICommit($conn);
echo "Blob successfully uploaded\n";
} else {
echo "Couldn't upload Blob\n";
}
OCIFreeStatement($stat);
OCILogoff($conn);
?>
Expected result:
----------------
I espect to record the content of the variable $large_text (containing a
large text) in the field "field" in the table "table".
Actual result:
--------------
Two warnings:
1 - In OCIExecute line php warning:
"Warning: ociexecute(): OCIStmtExecute: ORA-22275: invalid LOB locator
specified in "this file" on line "OCIExecute line"
2 - In the last "if" line, when execute the save method, warning:
"Warning: save(): OCILobWrite: OCI_INVALID_HANDLE in "this file" on line
"that line"
And no any changes in database. I can't record anything :(
--
Edit bug report at http://bugs.php.net/?id=39147&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39147&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39147&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39147&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39147&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=39147&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39147&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39147&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39147&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39147&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39147&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=39147&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=39147&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39147&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39147&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39147&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39147&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39147&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39147&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39147&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39147&r=mysqlcfg