Skip to content

What expression should be used in a Database Task's Custom scheduling option to have it execute every 30 minutes, Monday through Friday only, skipping Saturday and Sunday entirely?

Answer

The Custom scheduling expression needs to compute and return the DATE of the NEXT execution, with one day as its base unit. Use a CASE expression that checks the current day of week via TO_CHAR(SYSDATE, 'DY'), and if it lands on a weekend day, jumps forward to the next valid weekday's start; otherwise it just adds the desired interval directly to SYSDATE, for example SYSDATE + 30/24/60 for a 30-minute interval. The exact day-name comparison and jump-forward logic needs to account for which day of the week your Oracle NLS/session settings treat as the start of the week, Sunday vs Monday, so the precise CASE expression may need slight adjustment depending on your own database's day-of-week configuration.

← Browse Developer Studio, deployment, and upgrades questions