Question:I could not pass CLOB from PHP into stored procedure in Oracle DB and I do not not why.
I think, I follow the examples in PHP and other sites, but I need to use clob as IN parameter
not just select, update or output. I always get the error:
OCI-Lob::write(): OCI_INVALID_HANDLE
What is wrong? Better how can I do that?
Test case:(1) ORACLE side:
create procedure TMP_TEST(pMyClob in CLOB)
is
begin
null ; // something, not important ...
end ;
(2) PHP client side:
<?
$s = 'some input some input ... some input';
$query = "begin TMP_TEST( pMyClob => :abcde ); end; ";
$conn = OCI_Connect($user, $pass, $db, $charset);
$stmt = OCI_Parse($conn, $query);
$cin = OCI_New_Descriptor($conn, OCI_DTYPE_LOB) ;
OCI_Bind_By_Name($stmt, ':abcde', $cin, -1, OCI_B_CLOB);
OCI_Execute($stmt);
$cin->write($s); // THIS PRODUCE AN ERROR
@OCI_Free_Statement($stmt);
@OCI_Close($conn);
?>