我正在尝试以与插入相同的方式更新(C)LOB。(插入已经在工作)。
$queryHandle = oci_parse($dbHandle, "update MYTABLE set "MYCLOB" = EMPTY_CLOB() , "OTHERCOL" = :col0 where "PKIDCOL" = :wherecol0 returning "OTHERCOL" , "MYCLOB", into :retcol0 , :retcol1");
if(!is_resource($queryHandle)) {
$error=oci_error($dbHandle);
die($error['message'], $error['code']);
}
oci_bind_by_name($queryHandle, ":col0", $othercolvalue);
oci_bind_by_name($queryHandle, ":wherecol0", $pkidcol);
oci_bind_by_name($queryHandle, ":retcol0", $retcol1, 100);
$lob=oci_new_descriptor($dbHandle);
oci_bind_by_name($queryHandle, ":retcol1", $lob, -1, SQLT_CLOB);
if(!oci_execute($queryHandle , OCI_NO_AUTO_COMMIT)) {
$error=oci_error($dbHandle);
die($error['message'], $error['code']);
}
$lob->save($mylobvalue); // gives an PHP Warning: OCI-Lob::save(): OCI_INVALID_HANDLE in file.php on line 123
这不会更新 lob 并给出:PHP Warning: OCI-Lob::save(): OCI_INVALID_HANDLE in file.php on line 123