日期:2014-05-16 浏览次数:21072 次
declare
a_bfile BFILE;
a_blob BLOB;
begin
insert into xxxx (DOC_CONTENT )
values (EMPTY_BLOB())
returning DOC_CONTENT into a_blob;
a_bfile := BFILENAME('MY_DIR','1.1.xml');
dbms_lob.fileopen(a_bfile);
dbms_lob.open(a_blob, dbms_lob.lob_readwrite);
dbms_lob.loadfromfile(a_blob, a_bfile, dbms_lob.getlength(a_bfile));
dbms_lob.close(a_blob);
dbms_lob.fileclose(a_bfile);
commit;
end;
------解决方案--------------------
实测结果:
从图中可见,Oracle是不会检测你指定的目录是否是存在的。
文档中要求是全路径名,即指定的路径名一定得是一个在你的文件系统中真实存在的全路径名,
否则在创建的时候没问题,但一使用就出错了。
所以这时没有什么相对路径的概念。