编个程序,用文件流的方式把MP3文件读成BLOB类型的变量。
把BLOB类型的变量存到ORACLE中去。
把BLOB类型的变量存到ORACLE中去。
解决方案 »
- SQL代码优化
- oracle中报缺失表达式的错误,写错了吗,希望各位指点下
- oracle10g 表闪回,提示名称为ORA-01555:快照过旧:回退段号3("SYSSMU3$")过小
- oracle一次卸载后为什么不能再安装了,跪求各位大侠指点一二。
- group by查询问题
- 请问不用递归如何用一条sql查询树节点的所有嫡系祖先或所有嫡系后代
- 一个简单的排序和分组
- 安装好8.16在w2kads底下server端还要配置什么啊?oem怎么样配置?
- 要怎样才能把所有数据查询出来(不符合条件的也需要)
- 50分,我想知道linux下的oracle是否免费
- 有两张表A和B,请问这样的语句为什么不能够得到想要的结果?"SELECT A.字段名1, A.字段名2 FROM A,B WHERE A.字段名3=... AND A.字段名4
- 求助下载Developer 2000
然后你可以用存储过程或者前端应用来插如数据
例子:
grant create any directory to scott;
grant create any library to scott;
create or replace directory utllobdir as 'G:\oracle';
create table bfile_tab (bfile_column BFILE);
create table utl_lob_test (blob_column BLOB);set serveroutput on然后执行下面语句就将G:\oracle目录下的Azul.jpg存入到utl_lob_test
表中的blob_column字段中了。
declare
a_blob BLOB;
a_bfile BFILE := BFILENAME('UTLLOBDIR','Azul.jpg');
begin
insert into bfile_tab values (a_bfile)
returning bfile_column into a_bfile;
insert into utl_lob_test 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;
/
select dbms_lob.getlength(blob_column) from UTL_LOB_TEST;