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 -> Re: How to load pictures in Oracle 8?

Re: How to load pictures in Oracle 8?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 23 Jul 1999 14:02:07 GMT
Message-ID: <379e75c7.98379432@newshost.us.oracle.com>


A copy of this was sent to "jfguyard" <jfguyard_at_swissonline.ch> (if that email address didn't require changing) On Thu, 22 Jul 1999 12:19:47 GMT, you wrote:

>Hi
>
>Could any oracle guru tell me how images (tiff, gif, jpeg) can be
>loaded into Oracle 8?
>Any further experience or recommandations are welcome.
>
>Thanks in advance and best regards.
>
>Jean François

Here is one way to load:

create table demo

( id            int primary key,
  theBlob       blob

)
/

create or replace directory my_files as '/export/home/tkyte/public_html';

declare

        l_blob  blob;
        l_bfile bfile;
begin
        insert into demo values ( 1, empty_blob() ) 
        returning theBlob into l_blob;

        l_bfile := bfilename( 'MY_FILES', 'aria.gif' );
        dbms_lob.fileopen( l_bfile );

        dbms_lob.loadfromfile( l_blob, l_bfile, 
                               dbms_lob.getlength( l_bfile ) );

        dbms_lob.fileclose( l_bfile );

end;
/

--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

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 Jul 23 1999 - 09:02:07 CDT

Original text of this message

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