note 18041 deleted from ref.oci8 by sixd
| From: | sixd@php.net | Date: | Tue, 01 Dec 2009 22:26:06 +0000 |
| Subject: | note 18041 deleted from ref.oci8 by sixd | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-163468@lists.php.net to get a copy of this message | ||
Note Submitter: edahnke at consultant dot com
----
Here's a little snipet that shows how to insert multiple clob fields. Worked for me.
$dbh = OCILogon($dst_user_name, $dst_password, $dst_db_name);
for($i = 0; $i < $src_rec_cnt; $i++) {
$query = "insert into bid (id,time,resume,experience,comments) values
('$id[$i]','$time[$i]',empty_clob(),empty_clob(),empty_clob()) returning
resume,experience,comments into :resume,:experience,:comments";
$stmt = OCIParse($dbh, $query);
$clob1 = OCINewDescriptor($dbh, OCI_D_LOB);
$clob2 = OCINewDescriptor($dbh, OCI_D_LOB);
$clob3 = OCINewDescriptor($dbh, OCI_D_LOB);
OCIBindByName ($stmt, ":resume", &$clob1, -1, OCI_B_CLOB);
OCIBindByName ($stmt, ":experience", &$clob2, -1, OCI_B_CLOB);
OCIBindByName ($stmt, ":comments", &$clob3, -1, OCI_B_CLOB);
OCIExecute($stmt, OCI_DEFAULT);
@$clob1->save ($resume[$i]);
@$clob2->save ($experience[$i]);
@$clob3->save ($comments[$i]);
OCICommit($dbh);