create or replace procedure sd_hospital.SP_ZY_BRQTJHDJ( Pbrid00 in number, Pzyid00 in number, Pbrzjbh in varchar2 )as Vcount0 number; --记数器 Verrmsg varchar2(255); --错误提示信息 -- MODIFICATION HISTORY -- Person Date Comments -- linzetao 2020.12.01 移植7.0同名过程 create for ZYSF9-20201127-003 -- --------- ---------- ------------------------------------------- begin Verrmsg:='调用过程: SP_ZY_BRQTJHDJ('||to_char(Pbrid00)||','||Pbrzjbh||') ; '; select count(1) into Vcount0 from YS_QTJHXX where BRZJBH=trim(Pbrzjbh) and (JHQXRQ='' or JHQXRQ is null) ; if (Vcount0>0) then update ZY_BRXXB0 set QTJHBZ='1' where ZYID00=Pzyid00; else update ZY_BRXXB0 set QTJHBZ='0' where ZYID00=Pzyid00; end if; exception when others then rollback; raise_application_error(-20266,substrb(nvl(sqlerrm, '住院登记千天计划失败')||'!*'||Verrmsg,1,120)); end;