//sys create directory LOB_DIR as 'c:/temp'; grant read on directory LOB_DIR to testuser; //testuser create table ATTACH_FILE ( TENPU_NO CHAR(9) not null, TENPU_FILE BLOB, TENPMT_DIR_NM VARCHAR2(128), TENPMT_FILE_NM VARCHAR2(128), UPDATE TIMESTAMP(6) not null, UPD_USR CHAR(7) not null ) declare bmp_file bfile := bfilename( 'LOB_DIR', 'xxxx.png'); v_blob_data blob; begin insert into ATTACH_FILE values( '000000001', empty_blob(), 'C:/temp', 'xxxx.png', '090624', 'xxxxx') returning TENPU_FILE into v_blob_data; dbms_lob.fileopen( bmp_file, dbms_lob.file_readonly); dbms_lob.loadfromfile( v_blob_data, bmp_file, dbms_lob.getlength( bmp_file )); dbms_lob.fileclose( bmp_file ); commit; end; /
loadfromfile
最新推荐文章于 2022-01-20 10:34:24 发布