不好意思,我又卡住了,我在pb里运行管道,提示(ORA-01401: 插入的值对于列过大),也就是说trigger没有执行select into语句,但我肯定if length(:new.xb)>1 then 是执行的,有谁能帮我看看,我要实现的功能是通过trigger将一些字段值通过代码表转换成代码,然后才插入到数据库表中(注:trigger 编译通过)
create or replace trigger tri_tsrq_ztry_xxb BEFORE insert or update on tsrq_ztry_xxb
FOR EACH ROW
declare
ls_xb varchar2(1);
ls_lx varchar2(4);
ls_tx varchar2(4);
ls_sf varchar2(3);
ls_ajlxnr varchar2(6);
ls_flag varchar2(1);
begin
if length(:new.xb)>1 then
ls_flag :='1';
select zddm into ls_xb from xb_zd where ctnr=:new.xb;
select lxdm into ls_lx from ztlx_dmb where lxnr=:new.lx;
select txdm into ls_tx from zttx_dmb where txnr=:new.tx;
select sfdm into ls_sf from ztsf_dmb where sfnr=:new.sf;
select ajlbdm into ls_ajlxnr from ztajlb_dmb where ajlxnr=:new.ajlb;
end if;
if inserting then
if :new.sfst is null and :new.ztfa is null then
if ls_flag='1' then
:new.xb :=ls_xb;
:new.lx :=ls_lx;
:new.tx :=ls_tx;
:new.sf :=ls_sf;
:new.ajlb :=ls_ajlxnr;
:new.sfst :='1';
:new.ztfa :='2';
else
:new.sfst :='1';
:new.ztfa :='1';
end if;
end if;
end if;
if updating then
:new.xb :=ls_xb;
:new.lx :=ls_lx;
:new.tx :=ls_tx;
:new.sf :=ls_sf;
:new.ajlb :=ls_ajlxnr;
:new.sfst :='1';
:new.ztfa :='1';
end if;
end;
/