u010953969
淡然于世
采纳率0%
2015-02-27 10:08 阅读 1.8k

Oracle数据库使用存储过程上传大图片 blob参数 ,上传失败怎么会事?

procedure proc1(

Attachmen in out blob, --附件

)
is
i integer;
atta blob;
begin
dbms_lob.createtemporary(atta,true);
select we.nextval into i from dual;

insert into t_TrafficInfor
(id,Attachment)
values(i,EMPTY_BLOB());
if(Attachmen is not null)then
select Attachment into atta
from t_TrafficInfor
where id=i for update;
--打开DBMS_LOB()包
dbms_lob.open(Attachmen,dbms_lob.lob_readonly);
DBMS_LOB.OPEN(atta, DBMS_LOB.lob_readwrite);
--追加要插入的照片到指定位置
--DBMS_LOB.append(atta,attachmen);
dbms_lob.write(atta,500000,0,Attachmen);
dbms_lob.close(Attachmen);
dbms_lob.close(atta);
end if;
end;

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • u010953969 淡然于世 2015-02-28 03:21

    没币,拜托各位大神了。。

    点赞 评论 复制链接分享

相关推荐