Alter Schedule

Summary

The ALTER SCHEDULE command modifies the specified schedule.

Syntax

alter schedule [if exists] <schedule_name> as ( [parameter_list] );

Parameters

Parameter
Parameter List
Description
[if not exists] (Optional) Create the schedule only if the schedule does not currently exist (the schedule has not already been created).
<schedule_name>
The name of the schedule.
[parameter_list]
("Pipeline"|"Step")=<name>
The name of the pipeline or step to run at the scheduled time. If thePipeline parameter is specified, the Step parameter is ignored.
Cron='cron string'
A Quartz cron string expression with a maximum granularity of 1 hour.

The cron expression has 5 placeholders:

  • Hour
  • Day of month
  • Month
  • Day of week
  • Year

A cron string expression with a maximum granularity of 1 hour. In other words, you may schedule a job to run once an hour at the most. Connect does not support second or minute intervals. You can use the cron expression to tell which hour of the day you want the schedule to fire. When you create or alter the schedule domain object with a specified hour, Connect will randomly assign the schedule to one of the following minute buckets: hour:00, hour:10, hour:20 , hour:30, hour:40, hour:50. Once set, the schedule will always fire at the assigned time, unless the schedule object is in a suspended state. Refer to SHOW SCHEDULES to view the minute value set by Connect.

Cron maker offers a useful utility for generating cron expressions. Remember, to only include the 5 expression placeholders supported in Connect.

Condition=<expression>
(Optional) An XSQL logical expression that evaluates totrue or false. The scheduled step or pipeline will fire if the expression evaluates to true. If false, the scheduled step or pipeline will not execute for the given schedule invocation. Default is true.
Retries=<integer>
(Optional) When the Condition parameter evaluates to false, specifies how many times to retry before proceeding to the OnConditionFalsestep.
RetryInterval=<retry interval in minutes>
(Optional) The number of minutes between each condition retry evaluation.
OnConditionFalse=<name of step to execute when condition fails>
(Optional) The name of the step to execute if the condition evaluates to falseafter all retries.Details

 

Examples

/* Create a schedule to run hourly */
 
alter schedule if exists s_p_triggers_monthly as
("Pipeline" = p_triggers_monthly,
Cron = '0 0 0/1 1/1 * ? *',
Condition = (:v_order_upload_completed),
Retries = 0,
RetryInterval = 0,
OnConditionFalse = s_email_upload_orders_failed);

Related Commands

CREATE SCHEDULE

DROP SCHEDULE

RESUME SCHEDULE

SHOW SCHEDULES

SUSPEND SCHEDULE