create or replace trigger syn_evt_attachment
after insert on evt_attachment
for each row
declare V_js_report_id varchar(10);
V_count number;
V_blob blob;
V_accessory blob;
V_buffer varchar2(2000);
begin
--查看是否有此id的进程报告
select count(*)
into V_count
from evt_report r
where r.reportid = :new.reportid
and r.isendcase = 'N';
if V_count > 0 then
--如果有,取出对应的江苏进程报告的id
select r.js_evt_reprot_rid
into V_js_report_id
from evt_report r
where r.reportid = :new.reportid
and r.isendcase = 'N';
--将附件的文件名和blob字段存储到进场报告中
update paroxysmal_event_info_list p
set p.accessory = empty_blob()
where p.rid = V_js_report_id;
V_blob :=:new.blobfile;
insert into syn_log(tablename) values(DBMS_LOB.GETLENGTH(V_blob));
--此处length为0
select p.accessory
into V_accessory
from paroxysmal_event_info_list p
where p.rid = V_js_report_id
for update;
dbms_lob.open(V_accessory, dbms_lob.lob_readwrite);
dbms_lob.append(V_accessory, V_blob);
dbms_lob.close(V_accessory);
end if;end;
怎样才能取到插入的blob,我这运行也不报错,但是blob就是没更新到paroxysmal_event_info_list中,请大侠们指点。
after insert on evt_attachment
for each row
declare V_js_report_id varchar(10);
V_count number;
V_blob blob;
V_accessory blob;
V_buffer varchar2(2000);
begin
--查看是否有此id的进程报告
select count(*)
into V_count
from evt_report r
where r.reportid = :new.reportid
and r.isendcase = 'N';
if V_count > 0 then
--如果有,取出对应的江苏进程报告的id
select r.js_evt_reprot_rid
into V_js_report_id
from evt_report r
where r.reportid = :new.reportid
and r.isendcase = 'N';
--将附件的文件名和blob字段存储到进场报告中
update paroxysmal_event_info_list p
set p.accessory = empty_blob()
where p.rid = V_js_report_id;
V_blob :=:new.blobfile;
insert into syn_log(tablename) values(DBMS_LOB.GETLENGTH(V_blob));
--此处length为0
select p.accessory
into V_accessory
from paroxysmal_event_info_list p
where p.rid = V_js_report_id
for update;
dbms_lob.open(V_accessory, dbms_lob.lob_readwrite);
dbms_lob.append(V_accessory, V_blob);
dbms_lob.close(V_accessory);
end if;end;
怎样才能取到插入的blob,我这运行也不报错,但是blob就是没更新到paroxysmal_event_info_list中,请大侠们指点。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货