prompt 1.026.获取发药等待人数 SF_PY_GETDDRS create or replace function SF_PY_GETDDRS -- MODIFICATION HISTORY -- Person Date Comments -- linshu 2021.12.28 create 获取发药等待人数; -- --------- ---------- ------------------------------------------- ( PYFBMBH in number , --发药药房 PFYDLXH in number , --队列序号 PFYCKBH in number --发药窗口编号 ) return number is VDDRS00 YF_CFDL00.DDRS00%type; begin begin select to_char(count(distinct FYDLXH)) into VDDRS00 from YF_CFDL00 where YFBMBH=PYFBMBH and PHRQ00=to_char(sysdate,'yyyymmdd') and ZT0000 in ('0','1') and FYDLXH 'N' then commit; end if; Pzxcgbz := 1; exception when Ecustom then Pxxxx00 := substr(SQLERRM||Ptsxx00||'执行存储过程错误:SP_SF_BYJJK0_JKFHCL',1,150); rollback; when others then Ptsxx00 := '出错原因未知!请记录此信息并和系统管理员联系!'; Pxxxx00 := substr(SQLERRM||'执行存储过程错误:SP_SF_BYJJK0_JKFHCL',1,150); rollback; end; / show error; --%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%