[编辑说明:在 PHP 5 中,不要在绑定调用中为参数使用“&”]
上面的代码在某种程度上是正确的...以下是我如何让 CLOB 工作的示例
<?php
function insert_adinfo($AdInfoID, $MagazineType, $Publish, $DatePost, $BodyText)
{
global $db;
$clob = OCINewDescriptor($db, OCI_D_LOB);
$stmt = OCIParse($db,"insert into tblAdInfo values ($AdInfoID, $MagazineType, '$Publish', to_date('$DatePost', 'YYYY-MM-DD'), EMPTY_CLOB()) returning BodyText into :the_blob");
OCIBindByName($stmt, ':the_blob', &$clob, -1, OCI_B_CLOB);
OCIExecute($stmt, OCI_DEFAULT);
if($clob->save($BodyText)){
OCICommit($db);
}else{
echo "Problems: Couldn't upload Clob\n";
}
OCIFreeDescriptor($clob);
OCIFreeStatement($stmt);
}
?>