BLOB存入文件

1.向blob字段插入文本
INSERT INTO lobdemo (key, clob_col, blob_col, bfile_col) VALUES (51, 'This is another character literal', HEXTORAW('ABABABABABABABABABAB'),  NULL);

2.更新blob字段文本
UPDATE peoplesoft  SET SUPPLIER_ID = HEXTORAW('CDCDCDCDCDCDCDCDCDCDCDCD') where rownum =2;
update PEOPLESOFT_1M set supplier_id = utl_raw.cast_to_raw(vendor_id) ;

3.向blob字段插入文件

CREATE TABLE yuser (ID number,photo BLOB);

create or replace directory images as '/test';

 declare
   l_bfile bfile;
   l_blob blob;
 begin
   insert into yuser(ID,photo) values(1,empty_blob())
   return photo into l_blob;
   l_bfile:=bfilename('IMAGES','test.doc'); --IMAGES 是上面創(chuàng)建目錄的大寫
   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的方式

10年積累的網(wǎng)站建設(shè)、成都網(wǎng)站設(shè)計經(jīng)驗,可以快速應(yīng)對客戶對網(wǎng)站的新想法和需求。提供各種問題對應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認識你,你也不認識我。但先網(wǎng)站設(shè)計后付款的網(wǎng)站建設(shè)流程,更有偏關(guān)免費網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。

declare
   l_bfile bfile;
   l_blob blob;
 begin
   update yuser set photo = empty_blob() where id = 2
   return photo into l_blob;
   l_bfile:=bfilename('IMAGES','PS.pdf');
   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;
 、

分享名稱:BLOB存入文件
網(wǎng)頁網(wǎng)址:http://bm7419.com/article34/pscise.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站收錄、移動網(wǎng)站建設(shè)小程序開發(fā)、關(guān)鍵詞優(yōu)化動態(tài)網(wǎng)站、微信小程序

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計