我想把所建目录下的文本文件内容存放到TABLE中的CLOB字段中,
但当我在SQL/PLUS执行完过程sp_testlob_1后,发现字段lob1里全是乱码,请教为什么,?create table testlob(
id number,
lob1 clob
);insert into testlob (id,lob1) values(1,'abc');create or replace procedure sp_testlob_1
is
bfTestFile BFILE;
lobReturn CLOB;
begin
select lob1 into lobreturn from testlob where id=1 for update;
bfTestFile := BFILENAME('DIR_LOB_1','lob.txt');
dbms_lob.fileopen(bftestfile,dbms_lob.file_readonly);
dbms_lob.loadfromfile(lobreturn,bftestfile,dbms_lob.getlength(bftestfile));
commit;
dbms_lob.fileclose(bftestfile);
end sp_testlob_1;其中lob.txt为纯文本文件
但当我在SQL/PLUS执行完过程sp_testlob_1后,发现字段lob1里全是乱码,请教为什么,?create table testlob(
id number,
lob1 clob
);insert into testlob (id,lob1) values(1,'abc');create or replace procedure sp_testlob_1
is
bfTestFile BFILE;
lobReturn CLOB;
begin
select lob1 into lobreturn from testlob where id=1 for update;
bfTestFile := BFILENAME('DIR_LOB_1','lob.txt');
dbms_lob.fileopen(bftestfile,dbms_lob.file_readonly);
dbms_lob.loadfromfile(lobreturn,bftestfile,dbms_lob.getlength(bftestfile));
commit;
dbms_lob.fileclose(bftestfile);
end sp_testlob_1;其中lob.txt为纯文本文件
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货