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: Sandy Gutheinz <gutheinz_at_earthlink.net>
Date: Fri, 31 Mar 2000 09:21:27 -0800
Message-ID: <38E4DE97.ED57F4A5@earthlink.net>


Thanks, That works better now.
However, I encounter another problem when transfering the file. When it's a *.txt format, it seems to do fine on the file output, and small *.gif files. But when I tried to use utl_file.put to get of *.doc, or larger *.gif, it has either an error or it cannot be recogonized. The output file is somewhat larger than the original file size. Is there a solution to this?

Thanks again,
- Sandy

"Ms. D.H. Harvey" wrote:

> 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 Fri Mar 31 2000 - 11:21:27 CST

Original text of this message

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