oracle中插入一个blob数据

create or replace directory utllobdir as 'c:\xxx'; --你的BLOB文件所在位置。
create table bfile_tab (bfile_column BFILE);
create table t (blob_column BLOB);
----------------------------------------
declare
   a_blob  BLOB;
   a_bfile BFILE := BFILENAME('UTLLOBDIR','BLOB文件名');
begin
   insert into bfile_tab values (a_bfile)
     returning bfile_column into a_bfile;
   insert into t values (empty_blob())
     returning blob_column into a_blob;
   dbms_lob.fileopen(a_bfile);
   dbms_lob.loadfromfile(a_blob, a_bfile, dbms_lob.getlength(a_bfile));
   dbms_lob.fileclose(a_bfile);
   commit;
end;
原文地址:https://www.cnblogs.com/ballpenxp/p/890444.html