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

Home -> Community -> Mailing Lists -> Oracle-L -> Inserting BLOB from a Client

Inserting BLOB from a Client

From: <azhar_at_mathtech-pk.com>
Date: Tue, 12 Sep 2000 12:02:14 GMT
Message-Id: <10617.116713@fatcity.com>


Hi all,
i want to insert and retreive blob from server using developer2000 and oracle8i, i have used the method given below to insert blob into the database. but it only works when the directory object is given path on server . suppose i give path as

create or replace directory my_files as '\\MACHINE1\DIR' , THEN IT DOES NOT WORK . Is it possible to do it or any other way out . The way which i figured out is to copy file using HOST command in developer 2000 in a server directory and then insert file into server using the procedure gieven below. But it is not practical ,

how can i insert the file just from client running developer2000 without copying to server? i dont want to copy file to server first and then insert into database.

Kindly help out
Regards,

create table demo
( id int primary key,
  theBlob blob
)
/

create or replace directory my_files as
'c:\temp';

create or replace procedure load_a_file( p_file in varchar2 ) as

    l_blob blob;
    l_bfile bfile;
begin

    insert into demo values ( 1, empty_blob() )     returning theBlob into l_blob;
    l_bfile := bfilename( 'MY_FILES', p_file );     dbms_lob.fileopen( l_bfile );
    dbms_lob.loadfromfile( l_blob, l_bfile,

                           dbms_lob.getlength( l_bfile ) );
    dbms_lob.fileclose( l_bfile );
end;
/

Azhar Siddiq,
Mathtech, Pakistan
#18, F-8/3 Main Margalla Road,
Islamabad, Pakistan.
Tel: 92 51 111101101
Fax: 92 51 255989
e-mail: azhar_at_mathtech-pk.com Received on Tue Sep 12 2000 - 07:02:14 CDT

Original text of this message

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