Schedule syntax

Schedule syntax
schedules : { AUTOMATIC | schedule-spec ,... }
schedule-spec :
   { START TIME start-time | BETWEEN start-time AND end-time }
   [ EVERY period { HOURS | MINUTES | SECONDS } ]
   [ ON { ( day-of-week, ... ) | ( day-of-month, ... ) } ]
   [ START DATE start-date ]
Parameters
  • AUTOMATIC   For transmission rules, rules are evaluated when a message changes state or there is a change in network status. For delete rules, messages that satisfy the delete rule condition are deleted when a message transmission is initiated.

  • schedule-spec   Schedule specifications other than AUTOMATIC specify times when conditions are to be evaluated. At those scheduled times, the corresponding condition is evaluated.

  • START TIME   The first scheduled time for each day on which the event is scheduled. If a START DATE is specified, the START TIME refers to that date. If no START DATE is specified, the START TIME is on the current day (unless the time has passed) and each subsequent day (if the schedule includes EVERY or ON).

  • BETWEEN ... AND ...   A range of times during the day outside of which no scheduled times occur. If a START DATE is specified, the scheduled times do not occur until that date.

  • EVERY   An interval between successive scheduled events. Scheduled events occur only after the START TIME for the day, or in the range specified by BETWEEN ... AND.

  • ON   A list of days on which the scheduled events occur. The default is every day if EVERY is specified. Days can be specified as days of the week or days of the month.

    Days of the week are Mon, Tues, and so on. You may also use the full forms of the day, such as Monday. You must use the full forms of the day names if the language you are using is not English, is not the language requested by the client in the connection string, and is not the language that appears in the server window.

    Days of the month are integers from 0 to 31. A value of 0 represents the last day of any month.

  • START DATE   The date on which scheduled events are to start occurring. The default is the current date.

Usage

You can create more than one schedule for a given condition. This permits complex schedules to be implemented.

A schedule specification is recurring if its definition includes EVERY or ON; if neither of these reserved words is used, the schedule specifies at most a single time. An attempt to create a non-recurring schedule for which the start time has passed generates an error.

Each time a scheduled time occurs, the associated condition is evaluated and then the next scheduled time and date is calculated.

The next scheduled time is computed by inspecting the schedule or schedules, and finding the next schedule time that is in the future. If a schedule specifies every minute, and it takes 65 seconds to evaluate the conditions, it runs every two minutes. If you want execution to overlap, you must create more than one rule.

  1. If the EVERY clause is used, find whether the next scheduled time falls on the current day, and is before the end of the BETWEEN ... AND range. If so, that is the next scheduled time.
  2. If the next scheduled time does not fall on the current day, find the next date on which the event is to be executed.
  3. Find the START TIME for that date, or the beginning of the BETWEEN ... AND range.

The QAnywhere schedule syntax is derived from the SQL Anywhere CREATE EVENT schedule syntax.

Keywords are case insensitive.

See also
Example

The following sample server transmission rules file applies to the client identified by the client message store ID sample_store_id. It creates a dual schedule: high priority messages are sent once an hour. The schedule is every 1 hours and the condition is ias_priority=9. Also, between the hours of 8 A.M. and 9 A.M., high priority messages are sent every minute.

[sample_store_id]
; This rule governs when messages are transmitted to the client
; store with id sample_store_id.
;
   START TIME '06:00:00' EVERY 1 hours = ias_Priority = 9
   BETWEEN '08:00:00' AND '09:00:00' EVERY 1 minutes = ias_Priority = 9