Oracle存储过程方式存入文件(适用delphi)

2014-11-24 11:52:03 · 作者: · 浏览: 0

CREATE OR REPLACE PROCEDURE POLICE.updateImage (p_picid VARCHAR2,dd_code VARCHAR2, p_Value OUT bLOB)

is

isExists number;

begin

select count(*) into isExists from p_dang_pic where picid=p_picid;

if isExists>0 then

update p_dang_pic set image=empty_blob() where picid=p_picid returning image into p_Value;

else

insert into p_dang_pic(id,image,picid,dd_code) values (police.SEQPICID.nextval,empty_blob(),p_picid,dd_code) returning image into p_Value;

end if;

end;