Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: export BLOB TO a FILE ? HELP!
A copy of this was sent to "bee" <julienpi_at_iii.org.tw>
(if that email address didn't require changing)
On 28 May 1999 03:31:45 GMT, you wrote:
>I plan to use BLOB to store some multimedia data(images, sound..etc.), and
>display these data on web through an web application, thus we need to export
>BLOB or the RAW buffer into files. However I can't find any PL/SQL procedure
>to do this. Is there any way to solve this? I'm a junior programmer, and new
>to the multimedia database development using Oracle 8i. Any opinion would be
>very appreciated.
>
>
>
Are you using the plsql cartridge? if so, its as easy as:
create or replace package image_get
as
procedure gif( p_id in demo.id%type );
end;
/
create or replace package body image_get as
procedure gif( p_id in demo.id%type )
is
l_lob blob; l_amt number default 30; l_off number default 1; l_raw raw(4096); begin select theBlob into l_lob from demo where id = p_id; owa_util.mime_header( 'image/gif' ); begin loop dbms_lob.read( l_lob, l_amt, l_off, l_raw ); htp.prn( utl_raw.cast_to_varchar2( l_raw ) ); l_off := l_off+l_amt; l_amt := 4096; end loop; exception when no_data_found then NULL; end;
end;
/
No intermediate file necessary.
See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'...
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA
--
Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Fri May 28 1999 - 07:00:41 CDT
![]() |
![]() |