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 -> Re: Help!!! Get File back from Blob?

Re: Help!!! Get File back from Blob?

From: Ms. D.H. Harvey <qq45_at_liverpool.ac.uk>
Date: 30 Mar 2000 07:59:52 GMT
Message-ID: <8bv1ho$jrc$1@news.liv.ac.uk>


Sandy

Think your problem might be that dbms_lob.read buffer is datatype raw. Take a look at utl_raw.cast_to_varchar2.

HTH Helen  

Sandy Gutheinz (gutheinz_at_earthlink.net) wrote:
: 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 Thu Mar 30 2000 - 01:59:52 CST

Original text of this message

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