为什么V_COUNT一直等于 0 。
触发器:
V_PACTCODE := '''' || SUBSTR(:new.FPACTCODE,0,INSTR(:new.FPACTCODE,'-',1,4)-3) || '''';
V_FDBS := '''' || :new.FDBS || '''';
V_DWBH := '''' || :new.DWBH || '''';
V_COUNT:=f_getestsumrowcount(V_YEAR,V_PACTCODE,V_FDBS,V_DWBH);
if V_COUNT = 0 then
begin
  dbms_output.putline('ok');
end;
else
begin
  dbms_output.putline('no');
end;
end if;
函数:
CREATE OR REPLACE FUNCTION F_GETESTSUMROWCOUNT(vpactyear in number,vpactcode IN VARCHAR2,vfdbs in varchar2,vdwbh in varchar2) RETURN number AS
V_COUNT number:=0;
begin
  select count(*) into V_COUNT from APP_ESTIMATESUM where FPACTYEAR=vpactyear and FPACTCODE=vpactcode and FDBS = vfdbs and DWBH = vdwbh; 
  return V_COUNT;
END;oracle