Re: How-to store and retrieve graphic images

From: Thomas Jones-Low <tjoneslo_at_softstart.com>
Date: 1998/12/05
Message-ID: <36694C70.EC9B83D0_at_softstart.com>#1/1


        Which version of Oracle are you using?

        If you are using Oracle 8.0, use a BLOB data type. The RDBMS_LOB package handles loading and retrieving the images much more nicely than LONG RAW columns.

        Second, why is there a constraint on the JPEG_JFIF column? Remember that JPEG images have a header on them which is identical for each image, and this may be confusing the constraint checker for this column. Try removing the constraint.

Scot Balfour wrote:
>
> Hi, folks. My customer would like to store small thumbnail images of
> his employees (employee photographs) in an Oracle database. I need
> some help storing and retrieving (displaying) these images.
>
> I created a table (please forgive any syntax errors here, the table
> did create properly):
> employee_thumbnail
> (employee_id varchar2(15) constraint et_nn1 not null,
> jpeg_jfif long raw constraint et_nn2 not null,
> constraint et_pk primary key (employee_id))
>
> I tried to use the sql*loader to copy an image from the file-system
> into the table. Questions:
>
> * Is the long raw datatype the most appropriate for images?
> * Is the sql*loader a reasonable mechanism for copying images from
> the file system into the table?
> * When I tried to load the jpg image into the table, sql*loader
> loaded the first row from the image, then complained that the
> primary key definition prevented additional rows from being
> inserted. I understand why the pk prevented duplicate rows (with
> the same emp_id), but I was thinking that I could store the whole
> image (jpeg/gif whatever) as one row. One row would contain the
> whole image for one emp_id.
> * How best to resolve this situation so I can use Oracle Reports to
> correctly print the image in the report. In the class, we just
> set the datatype of a photograph field (from their play table) to
> image, and the picture was included in the report.
>
> Thanks for any advice. --Scot
 

-- 
	Thomas Jones-Low		JobScheduler for Oracle
	tjoneslo_at_softstart.com		
	Ph: 802-652-1596		http://www.softstart.com
Received on Sat Dec 05 1998 - 00:00:00 CET

Original text of this message