note 42273 added to ref.oci8
| From: | cyrill at _malevanov_dot_spb_dot_ru dot php dot net | Date: | Mon, 10 May 2004 17:05:48 +0000 |
| Subject: | note 42273 added to ref.oci8 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-69417@lists.php.net to get a copy of this message | ||
Passing CLOB to stored procedure and retrieve CLOB too (function lobinout(a in clob) return clob)
<?
error_reporting(1+2+4+8);
$conn = OCILogon('batdtd', 'batdtd', 'batxml');
$lobin = OCINewDescriptor($conn, OCI_D_LOB);
$lobout = OCINewDescriptor($conn, OCI_D_LOB);
$stmt = OCIParse($conn, "declare rs clob; begin :rs := lobinout(:par); end;");
$lob_data = 'abcdefgh';
echo "binding lobin...";
OCIBindByName($stmt, ':par', $lobin, -1, OCI_B_CLOB);
echo "done<br>binding rs...";
OCIBindByName($stmt, ':rs', $lobout, -1, OCI_B_CLOB);
echo "done<br>writing temp lob...";
// here we pass data to func
$lobin -> WriteTemporary($lob_data);
echo "done<br>executing...";
OCIExecute($stmt, OCI_DEFAULT);
// here we load data returned from func
echo "done<br>rs = ".$lobout->load();
OCICommit($conn);
$lobin -> free();
$lobout -> free();
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
----
Manual Page -- http://www.php.net/manual/en/ref.oci8.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42273
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42273&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42273&report=yes
Search -- http://master.php.net/manage/user-notes.php