create or replace function SP_YS_TSBRXXTS(ad_BRID00 number) return varchar2 is VCOUNT0 number(5); VMSG000 varchar2(120); -- MODIFICATION HISTORY -- Person Date Comments -- dsm 2017.11.16 create for MZYS-20171103-002 -- huangjy 2018.10.12 修正参数控制取值为Value0 for YF-20180720-001 begin VMSG000:=''; select count(*) into VCOUNT0 from BM_BRXXB0 where BRID00=ad_BRID00 and instr(BRZTQK,'建档立卡')>0; if VCOUNT0>0 then begin select substr(trim(VALUE0),3,100) into VMSG000 from XT_XTCS00 where NAME00='YS_DKTSBRTS' and substr(VALUE0,1,1)='Y'; exception when others then VMSG000:=''; end; end if; return VMSG000; end;