declare VYQDH00 XT_XTCS00.VALUE0%type; VBZBM00 JY_BGXMZD.BZBM00%type; V_COUNT number; V_SQL varchar2(2000); V_ERRO varchar2(20); --Person Date Comment --Nixj 2020.02.25 create for LIS9-20200318-011 begin --»ñÈ¡¹ÇËèÒÇÆ÷µ¥ºÅ V_ERRO :='AAA'; begin select VALUE0 into VYQDH00 from XT_XTCS00 where NAME00='JY_GSBGYQ'; exception when others then return; end; V_ERRO :='BBB'; select count(1) into V_COUNT from JY_JYYQZD where instr(','||:new.YQDH00||',',','||VYQDH00||',')>0; --ÅжÏÊÇ·ñΪ¹ÇËèÒÇÆ÷ if V_COUNT=0 then return; end if; V_ERRO :='CCC'; --if :new.BGXMID<999990 then if INSERTING then V_ERRO :='DDD'||:new.BGXMID; begin select trim(BZBM00) into VBZBM00 from JY_BGXMZD where BGXMID=:new.BGXMID; exception when others then VBZBM00:=''; end; V_ERRO :='EEE'; select count(1) into V_COUNT from JY_GSBGD0 where YBH000=:new.YBH000 and PYRQ00=:new.PYRQ00; V_ERRO :='FFF'; if nvl(VBZBM00,'0')<>'0' then if (V_COUNT=0) then V_SQL:='insert into JY_GSBGD0(YBH000,PYRQ00,'||VBZBM00||'_XP,'||VBZBM00||'_SP) values('''||:new.YBH000||''','''||:new.PYRQ00 ||''','''||:new.JYJG00||''','''||:new.SP0000||''')'; else V_SQL:='update JY_GSBGD0 set '||VBZBM00||'_XP='''||:new.JYJG00||''','||VBZBM00||'_SP='''||:new.SP0000||''' where YBH000='''||:new.YBH000||''' and PYRQ00='''|| :new.PYRQ00||''' '; end if; sp_execute_sql(V_SQL); end if; V_ERRO :='GGG+bzbz00='||VBZBM00; elsif DELETING then delete JY_GSBGD0 where YBH000=:new.YBH000 and PYRQ00=:new.PYRQ00; end if; -- end if; exception when others then RAISE_APPLICATION_ERROR(-20001,V_ERRO||'дÈëJY_GSBGD0±íÓÐÎó!*') ; end;