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: to insert into blob

Re: to insert into blob

From: chaoping <zhuchaopku_at_263.net>
Date: Wed, 14 Mar 2001 06:52:06 -0800
Message-ID: <F001.002CC215.20010314054612@fatcity.com>

hi, gurus:

     i read the article of early time e and tried my self, hoping to insert a bin file into a lob column of the database.but failed.

my env:
win2000 prof+oracle817.

SQL> desc lobtable

 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------
 NAME                                      NOT NULL VARCHAR2(80)
 LARGEOBJ                                           BLOB

SQL> select name from lobtable;

NAME



test
test2
test3
and the largeobj of the third line is null.

first i created a directory:
SQL> create directory picture as 'h:\games'; Directory created.

then i wrote a stored program:
PROCEDURE LOAD_LOB is
  obj blob;
  fils bfile:=bfilename('picture','1.jpg');   amt integer:=4000000;
  begin

      select largeobj into obj from lobtable where name='test3';
      dbms_lob.fileopen(fils,dbms_lob.file_readonly);
      dbms_lob.loadfromfile(obj,fils,amt);
     commit;
     dbms_lob.fileclose(fils);

  end;

and the 1.jpg does exist in the h:\game\1.jpg and when i run the program, it said:
SQL> exec load_lob;
BEGIN load_lob; END;

*
ERROR at line 1:

ORA-22285: non-existent directory or file for FILEOPEN operation
ORA-06512: at "SYS.DBMS_LOB", line 475
ORA-06512: at "CHAOS.LOAD_LOB", line 7
ORA-06512: at line 1

i checked the dbms_lob package's reference,but can't find out what is wrong. i even tried replace the picture dir with 'h:\games', but also failed. can u give me some advice?
thanks alot.

zǞ&die;}ND
+irhZDO8nr&die;Ky޴V
+r5pzq<w9P9tT8'x>'z֜q,Ƣ).+-:Õ*.ǥ}bf)+-jq
+ j)fzh.+-}\ܜi
+I_at_ND
Received on Wed Mar 14 2001 - 08:52:06 CST

Original text of this message

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