Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to save a BLOB to a file on disk in PL/SQL
"zorro" <z_at_z.com> wrote in message news:<y0dZ9.130423$sV3.4961522_at_news3.calgary.shaw.ca>...
> I want to do it in PL/SQL, not in Java, Thanks.
I did not realize this before.... please DO NOT CROSSPOST to every Oracle group that you can spell.
If you are on 9i then you can use plsql as described in step 1.
> > 1) Use dbms_lob and utl_file packages. You should be able to open an
> > io stream by getting RAW data from BLOB column by using dbms_lob.read
> > and output to a file using utl_file.Put_Raw, theorectically because I
> > have not tested it myself.
If you are on pre 9i then you have no choice but to use java as described in step 2 or upgrade to 9i.
> > 2) Use java.sql and java.io api's and write a java stored procedure.
> > There are functions in java.sql to get to BLOB data. Look at
> > java.sql.Blob and java.sql.ResultSet.getBlob(). Once you get the
> > handle to InputStream from java.sql.Blob, you can use
> > java.io.FileOutputStream and write data to file.
Regards
/Rauf Sarwar
Received on Mon Jan 27 2003 - 17:39:15 CST