Oracle Bfile的處理
oracleBfile是oracle的一個(gè)lob類(lèi)型,但實(shí)際存儲(chǔ)文件時(shí)是存儲(chǔ)在磁盤(pán)上的,需要自己存儲(chǔ)
需要在oracle上創(chuàng)建一個(gè)目錄的引用
create or replace directory attach_dir as 'c:/oracle/tmp'
插入bfile時(shí)
insert into table values (bfilename('ATTACH_DIR','file.ext'));
注意目錄名必須大寫(xiě),oracle在創(chuàng)建目錄時(shí)內(nèi)部都給轉(zhuǎn)換成大寫(xiě)的了
也可以在創(chuàng)建目錄時(shí)
create or replace directory "attach_dir" as 'c:/oracle/tmp'
加上雙引號(hào)這樣就可以用小寫(xiě)的了(或大小寫(xiě)混合)。