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

Home -> Community -> Usenet -> c.d.o.misc -> Re: inserting images into BLOB column

Re: inserting images into BLOB column

From: André Hartmann <Andre.Hartmann_at_pace.de>
Date: Tue, 25 Jan 2000 17:40:04 +0100
Message-ID: <86kjl5$qjk$1@crusher.de.colt.net>


Hi,

  thanx a lot from me as well since this clue helped me along a bit... unfortunately it doesnt work for me fully. I am accessing the Oracle Server via SQL*Net as a client... so the file that I want to insert is not on the Server's file system and I dont have access to that file system. I get:

ERROR at line 1:

ORA-22288: file operation FILEOPEN failed
LFI-00108: Open expect the file [2000.01][txt] to exist.
ORA-06512: at "SYS.DBMS_LOB", line 370
ORA-06512: at line 8

So how can I insert my file (rather the binary data in it) into the database ... dbms_lob.write doesnt seem to work either since I keep getting:

ERROR at line 1:

ORA-21560: argument 2 is null, invalid, or out of range
ORA-06512: at "SYS.DBMS_LOB", line 518
ORA-06512: at "UADB_DEV.EXAMPLE_16", line 12
ORA-06512: at line 1

.. when I try Example_16 out of the Oracle8 documentation....

André Hartmann.
newby at the group.

>>
>
>
>See the details on the dbms_lob package. You can read/write lobs 32k at a
time
>(sort of like fread/fwrite in C). You can load lobs from files in one
call.
>
>Here is a short example but see the plsql manual in 8.0 or the LOB manual
in 8i.
>
>
>
>drop table demo;
>
>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://osi.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 Tue Jan 25 2000 - 10:40:04 CST

Original text of this message

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