0

I have a set of records with repeat_interval values in Oracle, such as:

FREQ = MINUTELY; INTERVAL = 30
SYSDATE + 20/(24*60*60)
NEXT_DAY(trunc(SYSDATE),'MON')+5/24

I want to calculate the interval of each job in seconds, i.e., the time in seconds until the job needs to start again.

I have tried various approaches, but none of them have worked. I'm looking for a clean and efficient solution to obtain the intervals in seconds without relying on string parsing.

Any suggestions or alternative solutions would be greatly appreciated.

MatBailie
  • 83,401
  • 18
  • 103
  • 137
  • Is the interval always an integer? Is it always on the first line, and end with a line break? What possible values are in the FREQ? Without knowing all the possible scenarios that can possibly exist, it's impossible to form a 100% reliable answer. – MatBailie Jul 10 '23 at 07:38
  • freq could be secondly, minutely and etc. i use oracle's view dba_scheduler_jobs and that have column repeat_interval. in this column i have this type of records SYSDATE + 5/(24*60*60), trunc(sysdate) + 28/24, NEXT_DAY(trunc(SYSDATE),'MON')+5/24 and some records like this. i think parsing this data is not a good idea but i don't know other solution. – saba artkmeladze Jul 10 '23 at 07:50

0 Answers0