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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Using SQL to load images into Oracle

Re: Using SQL to load images into Oracle

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sun, 22 Apr 2001 22:34:00 +0200
Message-ID: <tqf6etof9a6svuen1r0t3fcp3dut79a3n3@4ax.com>

On Sun, 22 Apr 2001 13:12:11 -0400, "Sean Kubovcik" <seank_at_centurytel.net> wrote:

>I created a table to store gif images to be used for a product catalog. The
>table layout is:
>Table name:
>IMAGES
>Columns:
>IMAGE_ID number 8
>IMAGE blob
>TYPE varchar2 50
>NAME varchar2 50
>
>I can't figure how to insert the images into my table. Can someone
>enlighten me on how to load the images into an Oracle table, such as
>previously defined? Some sample code would be great or point me in the
>right direction.
>
>Thanks in advance.
>Sean
>
>
>

So far I've never used it myself, but evidently this would require using the dbms_lob supplied package.
I've read the dbms_lob *chapter* in Steven Feuerstein's book on Oracle built-in packages quickly, and to me it looks like you need to setup a blob local variable, use dbms_lob.loadfromfile on that, and use dbms_lob.copy to get it in your database column.

If you don't want to modify the image a BFILE column may be more appropiate and it is definitely more easy to handle.

I will try to experiment wuth this tomorrow myself, and post my solution.

Hth,

Sybrand Bakker, Oracle DBA

Sybrand Bakker, Oracle DBA Received on Sun Apr 22 2001 - 15:34:00 CDT

Original text of this message

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