From: trent at low dot ru
Operating system: Linux, Win32
PHP version: 4CVS-2003-06-21 (stable)
PHP Bug Type: OCI8 related
Bug description: error while trying to save LOB
Description:
------------
I got these errors while trying to inputing string to LOB using LOB's
method save(); :
Warning: save() [function.save.html]: OCILobWrite: OCI_INVALID_HANDLE in
/www/sample.php on line 15
Warning: load() [function.load.html]: OCILobGetLength: OCI_INVALID_HANDLE
in /www/sample.php on line 19
This was tested with:
4.3.1-win32
4.3.1-linux
Latest snapshot on Linux.
Note: in oracle function there is in/out parameter used.
Additional exception from Oracle: ORA-22275: invalid LOB locator
specified.
Reproduce code:
---------------
//logging in
$conn = OCILogon('user', 'pass', 'srvname');
//creating new LOB locator
$clob = OCINewDescriptor($conn, OCI_D_LOB);
$sql = 'begin :ret:=test(lob_object=>:lob_object_param); end;';
//parsing query - ok
$stmt = OCIParse($conn, $sql);
//binding variables - ok
OCIBindByName($stmt, ':lob_object_param', &$clob, -1, OCI_B_CLOB);
OCIDefineByName($stmt, ':lob_object_param', $clob, OCI_B_CLOB);
OCIBindByName($stmt, ':ret', $return, 4);
OCIExecute($stmt, OCI_DEFAULT);
if($clob->save($param)) { // Warning: OCILobWrite: OCI_INVALID_HANDLE in
sample.php on line 15
OCICommit($conn); // this warning appears only when using method
save(); of LOB locator
}
print $clob->load(); // Warning: OCILobGetLength: OCI_INVALID_HANDLE in
sample.php on line 19
// when using load method in LOB locator
$clob->free();
OCIFreeStatement($stmt);
Expected result:
----------------
I'm trying to save string as CLOB using Oracle function.
I do expect it to work fine =)
Maybe I'm doing something extremely wrong?
If so, please, correct me.
Thanx in advance.
--
Edit bug report at http://bugs.php.net/?id=24278&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=24278&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=24278&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24278&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24278&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24278&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24278&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24278&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24278&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24278&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24278&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24278&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24278&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24278&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24278&r=gnused