BLOB 存入文件
发布时间:2020-12-12 14:38:13 所属栏目:百科 来源:网络整理
导读:CREATETABLEyuser(IDnumber,photoBLOB);createorreplacedirectoryimagesas'/test';declarel_bfilebfile;l_blobblob;begininsertintoyuser(ID,photo)values(1,empty_blob())returnphotointol_blob;l_bfile:=bfilename('IMAGES','test.doc');--IMAGES是上面创
CREATETABLEyuser(IDnumber,photoBLOB); createorreplacedirectoryimagesas'/test'; declare l_bfilebfile; l_blobblob; begin insertintoyuser(ID,photo)values(1,empty_blob()) returnphotointol_blob; l_bfile:=bfilename('IMAGES','test.doc');--IMAGES是上面创建目录的大写 dbms_lob.open(l_bfile,dbms_lob.file_readonly); dbms_lob.loadfromfile(l_blob,l_bfile,dbms_lob.getlength(l_bfile)); dbms_lob.close(l_bfile); commit; end; / update的方式 declare l_bfilebfile; l_blobblob; begin updateyusersetphoto=empty_blob()whereid=2 returnphotointol_blob; l_bfile:=bfilename('IMAGES','PS.pdf'); dbms_lob.open(l_bfile,dbms_lob.getlength(l_bfile)); dbms_lob.close(l_bfile); commit; end; 、 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- c# – 如何预加载WPF运行时引擎或如何减少加载时间?
- 如何在三列中拆分Oracle中的varchar列
- 自定义控件——自定义控件属性(attr.xml,TypedArray)
- c – 避免接受lambda的方法的const / non-const重复
- react-native – 在反应导航中使用redux集成的优势是什么?
- asset-pipeline – 没有路由匹配Rails中的资产/图像
- [Swift]LeetCode42. 接雨水 | Trapping Rain Water
- xsd – 在XML Schema中定义maxLength方面的语法是什么?
- Sqlite3支持的数据类型 日期函数 Sqlite3 函数
- cocos2dx 3.3 + lua 学习笔记(02)--- 游戏场景的基本搭建