#27164 [Opn->Bgs]: blob data failing to save using OCINewDescriptor save

From: Date: Fri, 06 Feb 2004 02:24:10 +0000
Subject: #27164 [Opn->Bgs]: blob data failing to save using OCINewDescriptor save
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-54488@lists.php.net to get a copy of this message
ID: 27164 Updated by: iliaa@php.net Reported By: dbliss at hireability dot com -Status: Open +Status: Bogus Bug Type: OCI8 related Operating System: Redhat kv 2.4.20-8 PHP Version: 4.3.5RC2 New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. This is a dupe of an already fixed bug. Previous Comments: ------------------------------------------------------------------------ [2004-02-05 16:59:43] dbliss at hireability dot com Description: ------------ We are using the Oracle 9.2 client and Apache 2.0.48 Saving a blob using the OCINewDescriptor method "save" causes "ocCILobWrite: illegal parameter value in OCI lob function" warning. All other data for the insert is saved but the blob data is lost. I tested using PHP 5 and there was no problem. I went back and used PHP 4.3.4 and there was no problem either. It seems 4.3.5RC2 is the problem. Reproduce code: --------------- $blob_data = fread(fopen("/file_location/file_name", "r"), filesize("/file_location/file_name")); $dbcon = OCILogon($dbUser,$dbPassword,$dbName); $lob = OCINewDescriptor($dbcon, OCI_D_LOB); $query = "INSERT INTO TABLE_NAME (TABLE_NAME_ID,BLOB_DATA) ". "VALUES (TABLE_NAME_SEQ.NEXTVAL, EMPTY_BLOB()) RETURNING ". BLOB_DATA into :BLOB_DATA"; $result = ociparse($dbcon,$query); OCIBindByName($results,":BLOB_DATA",$lob,-1,OCI_B_BLOB); OCIExecute($results,OCI_DEFAULT); $lob->save($blob_data); $lob->free(); Expected result: ---------------- $lob->save($blob_data); should return 1 and the data should be saved into the BLOB_DATA column of the table. Actual result: -------------- The rest of the data is saved into the table but $lob->svae($blob_data); returns nothing, the "ocCILobWrite: illegal parameter value in OCI lob function" error appears and no BLOB data is saved. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27164&edit=1

« previous php.bugs (#54488) next »