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

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

Re: Inserting BLOB from a Client

From: yong huang <yong321_at_yahoo.com>
Date: Wed, 13 Sep 2000 09:20:44 -0700 (PDT)
Message-Id: <10618.116850@fatcity.com>


http://osi.oracle.com/~tkyte/Misc/Passwords.html

you wrote:

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,

Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere! Received on Wed Sep 13 2000 - 11:20:44 CDT

Original text of this message

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