I have been hacking trying to save clobs to oracle 9i using packages, and been retricted to php 4.0.5. and OCI.
having finally got it working...
I hope it may be of use.
<?
//functioning CLOB saving to oracle procedures
// php v4.0.5
//--------PACKAGE SPEC---------------------------
//PACKAGE tempclobtest_package AS
//
//procedure saveClob (
// p_clob IN OUT CLOB
//);
//
//-- ##############################################
//END tempclobtest_package;
//------------------------------------------------
//------------PACKAGE BODY-----------------------
//PACKAGE BODY tempclobtest_package AS
//
//procedure saveClob (
// p_clob IN OUT CLOB
//) IS
//
//BEGIN
//
// INSERT into temp_clob values (
// EMPTY_CLOB()
// ) RETURNING A_CLOB INTO p_clob;
//
//END;
//
//-- ###############################################
//END tempclobtest_package;
//---------------------------------------------------
//db connection
$conn = OCIlogon("user","pw","TNS");
$sql = "begin tempclobtest_package.saveclob(:clob); end;";
$clob = OCINewDescriptor($conn, OCI_D_LO😎; //
$stmt = OCIParse($conn, $sql);
OCIBindByName ($stmt,':clob', &$clob , -1,OCI_B_CLOB );
if(!OCIExecute($stmt, OCI_DEFAULT)){print_r(OCIError($stmt));}else{echo "<br>execute success";}
if($clob->save($clobtext))
{
OCICommit($conn);
echo "<br>commit success";
}
else
{
print_r(OCIError($stmt));
}
//release resouces
$clob->free();
OCIFreeStatement($stmt);
?>