我必须返回将显示表中缺失数据的过程。
CREATE OR REPLACE PROCEDURE GETEMPLOYEE_INFO
(
P_CPNCOD in varchar2,
P_PAYDAT in date,
P_PAYTYP in varchar2,
P_ERV out varchar2)
is
R_DI_FILLODINF NUMBER(20);
BEGIN
FOR i IN (SELECT * FROM DI_ELEMOD)
LOOP
SELECT COUNT(*) INTO R_DI_FILLODINF
FROM DI_FILLODINF
WHERE P_CPNCOD=i.CPNCOD and
P_PAYDAT=i.PAYDAT and
P_PAYTYP=i.PAYTYP ;
if nvl(R_DI_FILLODINF,0)<=0
then
dbms_output.put_line ('missing data : ' || i.CPNCOD || i.PAYDAT || i.PAYTYP );
end if;
end loop;
EXCEPTION
WHEN OTHERS THEN NULL;
end;
/
但现在我的问题是,如果我输入日期“01-JUN-12”,那么输出应该显示缺失的数据,但只显示 2012 年的数据。请帮忙
非常感谢提前
DECLARE
V_INSTY DI_FILLODINF.INSTYP%TYPE;
BEGIN
GETEMPLOYEE_INFO ('CO','01-JUN-12','D',V_INSTY);
END;
/