Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Help!!! Get File back from Blob?

Help!!! Get File back from Blob?

From: Sandy Gutheinz <gutheinz_at_earthlink.net>
Date: Wed, 29 Mar 2000 11:28:39 -0800
Message-ID: <38E25967.7E1FAE51@earthlink.net>


I am new at Oracle and I need to put a file into the database BLOB and retrieve it back as a file.

I am able to load it into database using BFILE, but when I tried to take it out, the file is not recognizable. How do I get the original file back as the way I uploaded?

Here are my steps:
I have a text file with the following lines:
"This is a test"

using dbms_lob.open to open this file from hard disk using dbms_lob.loadfromfile to load it into the database The dbms_lob.getlength for the blob looks perfect

I then use utl_file.fopen to create the new file in the hard disk (test.txt)
using dbms_lob.read to read the data from the blob in database using utl_file.put to write the data to the new file

I kept repeading the above 2 lines until it reaches the end of the datalength.

Now when I open the test.txt file, it shows me something like this:
"42616279206C6F6F6B206174206D652"

instead of
"This is a test"

Please help,
-Sandy Gutheinz Received on Wed Mar 29 2000 - 13:28:39 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US