note 20688 deleted from function.ocinewdescriptor by didou

From: Date: Tue, 12 Aug 2003 08:32:55 +0000
Subject: note 20688 deleted from function.ocinewdescriptor by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-53959@lists.php.net to get a copy of this message
Note Submitter: ross_php_at_techmale_dot_com ---- 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); ?>

« previous php.notes (#53959) next »