note 20688 added to function.ocinewdescriptor

From: Date: Fri, 12 Apr 2002 11:32:50 +0000
Subject: note 20688 added to function.ocinewdescriptor
Groups: php.notes 
Request: Send a blank email to php-notes+get-29155@lists.php.net to get a copy of this message
I have working of getting php 4.0.5 to connect to oracle 9i and save clobs using a package. This works. src code below... obviously you need to create a table and package in oracle first. ----------php + package---------- <!-- SAVE CLOB to oracle using packaged procedure --> <!----------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; --------------------------------------------------> <? //data to save $clobtext="different dr2"; //db connection $conn = OCIlogon("user","pw","TNS"); $sql = "begin tempclobtest_package.saveclob(:clob); end;"; $clob = OCINewDescriptor($conn, OCI_D_LOB); // $stmt = OCIParse($conn, $sql); OCIBindByName ($stmt,':clob', &$clob , -1,OCI_B_CLOB ); if(!OCIExecute($stmt, OCI_DEFAULT)){print_r(OCIError($stmt));} else{echo "&ltbr>execute success";} if($clob->save($clobtext)) { OCICommit($conn); echo "&ltbr>commit success"; } else { print_r(OCIError($stmt)); } //release resouces $clob->free(); OCIFreeStatement($stmt); ?> -- http://www.php.net/manual/en/function.ocinewdescriptor.php http://master.php.net/manage/user-notes.php?action=edit+20688 http://master.php.net/manage/user-notes.php?action=delete+20688 http://master.php.net/manage/user-notes.php?action=reject+20688

« previous php.notes (#29155) next »