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

Home -> Community -> Usenet -> c.d.o.server -> Stored images as Long Raw in OAS 4/Oracle 8i

Stored images as Long Raw in OAS 4/Oracle 8i

From: Anthony Jackson <ajackson_at_et.byu.edu>
Date: Tue, 16 Jul 2002 11:56:55 -0600
Message-ID: <3D345E67.3070803@et.byu.edu>


I'm a bit confused about serving images from 8i through PL/SQL using OAS 4 when they are stored in a table as LONG RAWs. My understanding is that the LONG RAW length limit is 2GB however the code below only works for images below 32k. (or at least around 32k) Is this a problem with utl_raw.cast_to_varchar2? (I know the length limit of varchar2 is 32k) At first thought this was the problem, but I noticed the utl_raw.length procedure returns 0 if the size of the image is over 32k.

--Works for images under 32k
procedure display_image is

   theimage long raw;
begin

   select
     image
   into
     theimage
   from
     ida_dumb_images
   where
     id='1';

   owa_util.mime_header('image/png',true);    htp.prn(utl_raw.cast_to_varchar2(theimage)); end;

I've seen lots of good code for serving BLOBs. I would have gone with them, except that I don't have control over that department. Is there a way to do a dbms_lob.read function to get chunks of the image at a time?

Thanks,

Anthony Received on Tue Jul 16 2002 - 12:56:55 CDT

Original text of this message

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