RE: [PEAR] MDB documentation

From: Date: Tue, 09 Dec 2003 15:50:22 +0000
Subject: RE: [PEAR] MDB documentation
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-9417@lists.php.net to get a copy of this message
> From: Vincent DUPONT [mailto:Vincent.dupont@ausy.be] > Sent: Tuesday, December 09, 2003 4:41 PM > I really need help in using LOB, CLOB and BLOB data in MD. Could you help? > I've been able to insert a GIF file into a Oracle 9i databse, But I can't > fetch it. It seems the fetchBlob function is not implemented yet. I found > some hints from an article in php_mag.net, but they described well the > insert in DB, not the extract... Oracle uses the generic implementation inside MDB_Common > I create a GIF file, but this is empty > I guess there must be aloop with readLob... > > > here is my code snipset : > //try to fetch the blob > $query = "select t_blob from test where t_id = 6"; > $result = $conn->query($query); > if (MDB::isError($result)){ > $output .= "Error While fetching data.<br>"; > $output .= $result->getMessage(); > die($output); > } > $binary_lob = array( > 'Type'=>'outputfile', > 'Result'=>$result, > 'Row'=>0, > 'Field'=>'t_blob', > 'Binary'=>1, > 'FileName'=>'blob.gif' > ); > $blob = $conn->createLob($binary_lob); > $data=""; > $conn->readLob($blob, $data, 0); > if (MDB::isError($conn)){ > $output .= "Error while reading the BLOB.<br>"; > $output .= $conn->getMessage(); > die($output); > } > else{ > $output .= "READ LOB OK<br>"; > } I dont have time to dive into this atm sorry. Another script you may want to look at are the usage tests in the tests dir. There you will find some more code that implements the LOB fetching. I have never used the Oracle LOB support outside of the test script. But Oracle definitely passes the test script (aside from the fact that empty strings are stored as NULL in Oracle which I can do anything about). Regards, Lukas PS: please keep things on the pear-general@ list .. that way my answers make it into the archive which might help other people with similar questions

« previous php.pear.general (#9417) next »