note 37174 added to function.ocinewdescriptor
| From: | Nathan at rn2 dot php dot net | Date: | Wed, 05 Nov 2003 20:35:26 +0000 |
| Subject: | note 37174 added to function.ocinewdescriptor | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-59960@lists.php.net to get a copy of this message | ||
I found another method of inserting/updating lob data. It works the same was as passing lob
parameters to a stored procedure and avoids the need for a RETURNING clause.
$lob = OCINewDescriptor($conn, OCI_D_LOB);
$stmt = OCIParse($conn,"insert into $table (id, the_blob)
values(my_seq.NEXTVAL, :the_blob)");
OCIBindByName($stmt, ':the_blob', &$lob, -1, OCI_B_BLOB);
$lob->WriteTemporary($data);
OCIExecute($stmt, OCI_DEFAULT);
$lob->close();
$lob->free();
OCICommit($conn);
There are some cases involving triggers where you can't use a RETURNING clause, so this method
can come in handy. The case where I needed it was updating a view that had an instead-of update
trigger.
----
Manual Page -- http://www.php.net/manual/en/function.ocinewdescriptor.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37174
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37174&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37174&report=yes
Search -- http://master.php.net/manage/user-notes.php