I am trying to set a PL/SQL expression as REPEAT_INTERVAL of my job - unfortunately, it is not working.
I would like to include CASE expression within such a interval, for example, how to set repeat interval for the job starts in a full minute, lets say at 14:17:00, and if it is run on even minute it runs in 30 seconds next time, and if it is run on odd minute it starts on next minute, so the piece of its run schedule would look like:
14:17:00
14:18:00
14:18:30
14:19:00
14:20:00
14:20:30
14:21:00
and so on. I have tried with those expressions:
trunc(sysdate, 'MI') + CASE WHEN mod(to_number(to_char(sysdate, 'MI')), 2)=0 then (1/24/60/2) else (1/24/60) end case
SYSTIMESTAMP + CASE WHEN mod(to_number(to_char(sysdate, 'MI')), 2)=0 then INTERVAL '30' SECOND else INTERVAL '60' SECOND end case
they both work in SQL query, but I am unable to compile the JOB. How should such PL/SQL expression look like?
Alternatively, is there a way to make JOB compute its next run date on runtime? I have also tried to modify start date every time the job runs, but with no success - it looks like the job is using start date only once on its first run, and never again, even if the date is changed for a future date.