note 20605 modified in function.ocinewdescriptor by sixd
| From: | sixd@php.net | Date: | Thu, 08 Oct 2009 19:27:49 +0000 |
| Subject: | note 20605 modified in function.ocinewdescriptor by sixd | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-161553@lists.php.net to get a copy of this message | ||
I had the same problem with updating the lobs with shorter content as in one of the notes above. The
addition of "\0" at the end of the replacement text didn't help either. But the
following worked perfectly:
$sql = "UPDATE sometable SET lob_col = EMPTY_LOB() WHERE key_col = $key RETURNING lob_col INTO
:lob";
$stmt = OCIParse($conn,$sql);
$lob = OCINewDescriptor($conn,OCI_D_LOB);
OCIBindByName($stmt,':lob',&$lob,-1,OCI_B_BLOB);
OCIExecute($stmt,OCI_DEFAULT);
$lob->save($sometext);
$lob->free();
--was--
I had the same problem with updating the lobs with shorter content as in one of the notes above. The
addition of "\0" at the end of the replacement text didn't help either. But the
following worked perfectly:
$sql = "UPDATE sometable SET lob_col = EMPTY_LOB() WHERE key_col = $key RETURNING lob_col INTO
:lob";
$stmt = OCIParse($conn,$sql);
$lob = OCINewDescriptor($conn,OCI_D_LOB);
OCIBindByName($stmt,':lob',&$lob,-1,OCI_B_BLOB);
OCIExecute($stmt,OCI_DEFAULT);
$lob->save($sometext);
$lob->free();
http://php.net/manual/en/function.ocinewdescriptor.php