Skip to main content
Question

Schedule task exclude public holidays

  • March 9, 2026
  • 1 reply
  • 21 views

Forum|alt.badge.img+5

There is a requirement to schedule a database task to run on the 3rd working day of each month, excluding weekends and public holidays defined in the Public Holiday Compensation Schedule.

Using the custom scheduling execution plan, how can the public holidays be excluded?

The current execution plan is:

FREQ=MONTHLY; BYDAY=MON,TUE,WED,THU,FRI; BYSETPOS=3; BYHOUR=9; BYMINUTE=0; BYSECOND=0;

This execution plan schedules the task to run on the 3rd weekday of the month. However, it does not currently exclude the public holidays defined in the Public Holiday Compensation Schedule.

How can this execution plan be modified to exclude the holidays from that calendar?

1 reply

Forum|alt.badge.img+12
  • Hero (Customer)
  • March 10, 2026

You’d probably need to first build a PL/SQL expression that returns the right date using the Exception Calendar and then use that PLSQL expression in the scheduler. I don’t think you can do that straight with the DBMS scheduler syntax.

 

So basically create an API Getter function that always return the “next” execution date based on when it is executed, and then use that API Method as your custom execution plan. Everytime the schedule executes, it will rerun the API, determine the “next” date, and use that as your “next execution date”