国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 開(kāi)發(fā) > 綜合 > 正文

一個(gè)存儲(chǔ)過(guò)程,關(guān)于blob

2024-07-21 02:35:59
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

  好壞給點(diǎn)意見(jiàn),謝了
  
  
  代碼:--------------------------------------------------------------------------------
  create or replace PRocedure ps_cmpimage(
   p_srtid in cmpimage.cimg_srtid%type,
   p_id in cmpimage.cimg_id%type,
   p_filename in varchar2,
   p_title in cmpimage.cimg_title%type,
   p_flag in number,
   p_rowid in rowid)
   is
   image BLOB;
   sourcefile BFILE;
   cursor cur_cmpimage is
   select a.cimg_count,a.cimg_idate from cmpimage a
   where a.rowid=p_rowid;
   rowimage cur_cmpimage%rowtype;
  BEGIN
   if p_flag=0 then
   INSERT INTO cmpimage (cimg_srtid,cimg_id,cimg_image,cimg_title)
   VALUES (p_srtid,p_id,EMPTY_BLOB,p_title)
   RETURNING cimg_image INTO image;
   sourcefile := BFILENAME('PHOTO_DIR',p_filename);
   DBMS_LOB.OPEN(sourcefile, DBMS_LOB.LOB_READONLY);
   DBMS_LOB.LOADFROMFILE(image,sourcefile,DBMS_LOB.GETLENGTH(sourcefile));
   else
   if p_filename is null then
   update cmpimage a
   set a.cimg_srtid=p_srtid,a.cimg_id=p_id,a.cimg_title=p_title
   where a.rowid=p_rowid;
   else
   update cmpimage a
   set a.cimg_srtid=p_srtid,a.cimg_id=p_id,a.cimg_title=p_title
   where a.rowid=p_rowid;
   select a.cimg_image into image from cmpimage a
   where a.rowid=p_rowid
   for update;
   sourcefile := BFILENAME('PHOTO_DIR',p_filename);
   DBMS_LOB.OPEN(sourcefile, DBMS_LOB.LOB_READONLY);
   DBMS_LOB.LOADFROMFILE(image,sourcefile,DBMS_LOB.GETLENGTH(sourcefile));
   end if;
   end if;
   commit;
  end ps_cmpimage;--------------------------------------------------------------------------------
  
  
  相關(guān):
  -- Create Directory
  create or replace directory PHOTO_DIR
  as 'C:/WINNT/TEMP/';
  --grant
  grant create any directory to 用戶(hù)

上一篇:Data Server Scripts

下一篇:NULL 小議

發(fā)表評(píng)論 共有條評(píng)論
用戶(hù)名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 永州市| 阜康市| 开远市| 蒲江县| 达州市| 岱山县| 鸡东县| 定南县| 砚山县| 凉城县| 崇左市| 玉龙| 慈利县| 白沙| 乌审旗| 巨鹿县| 泾阳县| 常德市| 江山市| 石柱| 双城市| 阿瓦提县| 栾城县| 确山县| 藁城市| 南汇区| 忻城县| 黄平县| 安国市| 邯郸县| 玉屏| 临夏县| 收藏| 怀柔区| 大足县| 樟树市| 贞丰县| 盐山县| 繁昌县| 茶陵县| 泾川县|