diff --git a/functions/oci8.xml b/functions/oci8.xml index fddf9f48c0..4244295d42 100644 --- a/functions/oci8.xml +++ b/functions/oci8.xml @@ -1,5 +1,5 @@ - + Oracle 8 functions OCI8 @@ -782,6 +782,36 @@ Upload file: <input type="file" name="lob_upload"><br> OCIFreeStatement($stmt); OCILogoff($conn); } +?> + + + + OCINewDescriptor + +<?php + /* Calling PL/SQL stored procedures which contain clobs as input + * parameters (PHP 4 >= 4.0.6). + * Example PL/SQL stored procedure signature is: + * + * PROCEDURE save_data + * Argument Name Type In/Out Default? + * ------------------------------ ----------------------- ------ -------- + * KEY NUMBER(38) IN + * DATA CLOB IN + * + */ + + $conn = OCILogon($user, $password); + $stmt = OCIParse($conn, "begin save_data(:key, :data); end;"); + $clob = OCINewDescriptor($conn, OCI_D_LOB); + OCIBindByName($stmt, ':key', $key); + OCIBindByName($stmt, ':data', $clob, -1, OCI_B_CLOB); + $clob->WriteTemporary($data); + OCIExecute($stmt, OCI_DEFAULT); + OCICommit($conn); + $clob->close(); + $clob->free(); + OCIFreeStatement($stmt); ?>