create procedure insert_pro(p_xh in varchar2,p_qyid in varchar2,p_dlsid in varchar2,p_ypid in varchar2,p_sl in varchar2,p_htfs in varchar2,p_dgr in varchar2,p_dhg in varchar2,p_myfs in varchar2,p_note in varchar2)
as
begin
insert into yy_jh_cgjh(xh,qyid,dlsid,ypid,sl,htfs,dgr,dhg,myfs,lx,note)
value(p_xh||'123',p_qyid,p_dlsid,p_ypid,p_sl,p_htfs,
p_dgr,p_dhg,p_myfs,'3',p_note);
end;
/create or replace trigger trig_cgjh
after insert on yy_jh_cgjhfor each row
declare
lx yy_jh_cgjh.lx%type;
bz yy_jcxx_yp.hlbz%type;
yp yy_jcxx_yp.ypid%type;
begin
lx:=:new.lx;
yp:=:new.ypid;
select hlbz into bz from yy_jcxx_yp where ypid = yp;
if lx = '2' then
insert_pro(:new.xh,:new.qyid,:new.dlsid,:new.ypid,:new.sl,:new.htfs,
:new.dgr,:new.dhg,:new.myfs,:new.note)
end if ;
end trig_cgjh;
as
begin
insert into yy_jh_cgjh(xh,qyid,dlsid,ypid,sl,htfs,dgr,dhg,myfs,lx,note)
value(p_xh||'123',p_qyid,p_dlsid,p_ypid,p_sl,p_htfs,
p_dgr,p_dhg,p_myfs,'3',p_note);
end;
/create or replace trigger trig_cgjh
after insert on yy_jh_cgjhfor each row
declare
lx yy_jh_cgjh.lx%type;
bz yy_jcxx_yp.hlbz%type;
yp yy_jcxx_yp.ypid%type;
begin
lx:=:new.lx;
yp:=:new.ypid;
select hlbz into bz from yy_jcxx_yp where ypid = yp;
if lx = '2' then
insert_pro(:new.xh,:new.qyid,:new.dlsid,:new.ypid,:new.sl,:new.htfs,
:new.dgr,:new.dhg,:new.myfs,:new.note)
end if ;
end trig_cgjh;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货