create or replace PROCEDURE GETWORKDAYS
(
sdate IN VARCHAR2
, TDAYS OUT INTEGER
) AS
totalDays INTEGER:=0;
tempDate VARCHAR2(20);
tempWeek INTEGER;
BEGIN
TDAYS:=0;
select add_months(to_date(sdate, 'yyyy-mm-dd'),1)-to_date(sdate, 'yyyy-mm-dd') into totalDays from dual;
tempDate:= to_char(to_date(sdate, 'yyyy-mm-dd'),'yyyy-mm-dd');
loop
exit when totalDays=0;
totalDays:=totalDays-1;
select to_char(to_date(tempDate, 'yyyy-mm-dd'),'d') into tempWeek from dual;
IF (tempWeek!=7 and tempWeek!=1)
then
TDAYS:=TDAYS+1;
END IF;
select to_char(to_date(tempDate, 'yyyy-mm-dd')+1,'yyyy-mm-dd') into tempDate from dual;

end loop;

END GETWORKDAYS;

相关文章:

  • 2021-11-11
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2021-09-11
  • 2022-02-15
猜你喜欢
  • 2021-06-04
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2022-01-23
相关资源
相似解决方案