Hi Dominik,
the bad news is that you'd need all tables to extract a complete Interval definition.
In fact, I think it isn't feasible to reverse engineer an Interval definition and translate it into plain text.
It might work in some simple cases though.
I had a short look at the new view definitions written by Dieter.
Their complexity more or less shows what I meant in the first paragraph above.
An Interval that does nothing more than a "repeat" or an "every Monday at 10:00" will be relatively easy to recognize.
But in the common case, it'll be hard.
Just as an example of a more common case, I've seen requirements like:
A Batch should be submitted every 28th of the month, unless it is not a business day, in which case the Batch has to be submitted at the previous business day.
If I translate it to an Interval definition, the first thing that catches ones eye is the term "business day".
Usually it is all Mondays til Fridays with the exception of public holidays.
Hence we need an Interval to define the public holidays (or better the negation) first. It looks like
CREATE OR ALTER INTERVAL NON_HOLIDAYS
WITH
BASE = 1 DAY,
DURATION = 1 DAY,
SELECTION = (
'-12-25', '-12-26', /* Christmas every year */
'-12-31', '-01-01', /* Sylvester and New Years Day */
'2023-06-25' /* The boss's birthday */
), INVERSE;
In order to select Monday til Friday, we use something like:
CREATE OR ALTER INTERVAL BUSINESS_DAYS
WITH
BASE = 1 DAY,
DURATION = 1 DAY,
SELECTION = (1, 2, 3, 4, 5),
FILTER = (NON_HOLIDAYS);
This is basically all Mo-Fr without the holidays.
Now we need the 28th, 27th, 26th, 25th, 24th and 23th.
If the 28th is a Sunday in December, the 27th is a Saturday and the days before is Christmas. Hence the Job should run at the 24th.
For simplicity reasons I assume there are no more than three holidays in a row.
That looks like
CREATE OR ALTER INTERVAL TWENTY_EIGHTH_OR_BD_BEFORE
WITH
BASE = 1 MONTH,
DURATION = 1 DAY,
SELECTION = (28, 27, 26, 25, 24, 23),
FILTER = (BUSINESS_DAYS);
Finally we can complete the task:
CREATE OR ALTER INTERVAL FINAL_SCHEDULE
WITH
EMBEDDED = TWENTY_EIGHTH_OR_BD_BEFORE,
SELECTION = (-1); /* this selects the last day that isn't filtered out; usually the 28th */
This Interval can now be used as a filter in the GUI. (See screen shot).
If you now look at the structure of the statements, you see several selections. These are stored in the interval_selection table.
You also see a number of filters (non_holidays is used to filter the business_days, which is used to filter the twentyeight_or_bd_before), which are stored in the interval_hierarchy table.
I didn't use a dispatcher because I didn't need it here. But there are more possible implementations of the example requirement and it would have been possible to use a dispatcher, which is stored in the interval_dispatcher table.
Besides that, the GUI makes heavy use of the dispatcher Intervals. Hence you'll have to consider the table too.
The basic objects are stored in the intervall table (note the double "l", added to prevent name clashes with reserved words).
I think the easiest way to obtain the information is to add some hints in the name of the schedule.
Instead of "DAILY" you call it "DAILY_REP0600" or "DAILY_AT1000".
If this is not an option, I think the best alternative is to use Dieter's views and find out how to recognize the idea behind the schedules.
Small note: if you want to try the above, the 28th isn't a weekend in the next few months. You could adapt the scheme and use the 26th instead to see it working.
Best regards,
Ronald