note 41705 deleted from ref.oci8 by aidan
| From: | aidan@php.net | Date: | Sun, 08 Aug 2004 15:28:26 +0000 |
| Subject: | note 41705 deleted from ref.oci8 by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-74220@lists.php.net to get a copy of this message | ||
Note Submitter: cyrill@_malevanov_dot_spb_dot_ru
----
How to pass CLOB as a stored procedure parameter:
<?
error_reporting(1+2+4+8);
$conn = OCILogon('batdtd', 'batdtd', 'bathome');
$lob = OCINewDescriptor($conn, OCI_D_LOB);
$stmt = OCIParse($conn, "declare rs varchar2(32767); begin :rs := aaa(:par); end;");
$lob_data = 'abcdefgh';
echo "binding lob...";
OCIBindByName($stmt, ':par', &$lob, -1, OCI_B_CLOB);
echo "done<br>binding rs...";
$rs = '';
OCIBindByName($stmt, ':rs', &$rs, 32767);
echo "done<br>writing temp lob...";
$lob -> WriteTemporary($lob_data);
echo "done<br>executing...";
OCIExecute($stmt, OCI_DEFAULT);
echo "done<br>rs = '$rs'";
OCICommit($conn);
$lob -> free();
OCIFreeStatement($stmt);
OCILogoff($conn);
?>