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 client system

Inserting BLOB from client system

From: <azhar_at_mathtech-pk.com>
Date: Wed, 13 Sep 2000 10:04:47 +0500
Message-Id: <10617.116800@fatcity.com>


Dear

i want to insert and retrieve 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 given 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 ); Received on Wed Sep 13 2000 - 00:04:47 CDT

Original text of this message

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