Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: to insert into blob
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
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);
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Ǟ¨}ND
+irhZDO8nr¨KyV
+r5pzq<w9P9tT8'x>'z֜q,Ƣ).+-:Õ*.ǥ}bf)+-jq
+j)fzh.+-}\ܜi
+I_at_ND
Received on Wed Mar 14 2001 - 08:52:06 CST
![]() |
![]() |