Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP SQL Anywhere, on-demand edition 1.0 SP 6 » Task syntax

AlterSchedule task

Alters a task schedule.

Syntax 1 (SQL)
CALL DBCloud.AlterSchedule ( schedule_id=schedule_id [, optional-parameters ] )
Syntax 2 (Cloud Command utility)
dbcloudcmd run AlterSchedule schedule_id [ optional-parameters ]
Parameters
  • schedule_id

    The schedule to alter. Accepts a schedule name, ID, or search query that returns a schedule. (Required)

  • taskdefinition

    The task that is executed by the schedule. The default is the current value.

  • arguments

    The task's parameters. The default is the current value.

  • event_type

    The type of event. The default is the current value.

  • schedule_definition

    The schedule, in quotes. The default is the current value.

  • description

    The description of the schedule. The default is the current value.

  • object_etag

    Internal use only. The default is NULL.

  • object_updated

    The last time the object was modified. If provided, the task fails if the object has changed since the specified time. The default is NULL.

Required privileges

RunScheduleTask

Remarks
  • event_type

    This parameter causes the specified task to run every time a specified event occurs in the cloud. To view a list of event types and their descriptions, run dbcloudcmd describe type:EventType.

  • arguments

    The arguments parameter accepts an XML string containing the parameter information of the task being scheduled. The XML string must be specified as follows and must include one or more of the listed XML elements:

    <args>XML-elements</args>
    Arguments XML-elements Description
    <a name="parm1">argument-string-1</a> Parm1 is the task parameter name. Argument-string-1 is the task parameter value.
    <a name="parm2" is_null="1"/> Parm2 is the task parameter name. Setting the is_null attribute to 1 indicates that the task parameter value is NULL.
  • schedule_definition

    The allowed value for the schedule_definition parameter is an XML string containing the schedule information. The XML string must be specified as follows and must include one or more of the listed XML elements:

    <schedule>XML-elements</schedule>
    Schedule XML-elements Description
    <time_range start_time="xx"/> Start time.
    <start_date date="xx"/> Start date.
    <interval frequency="xx" units="yy"/> Frequency of event. xx is an integer and yy is one of "HOURS", "MINUTES", or "SECONDS".
    <days_of_week><dow day="xx"/></days_of_week> Day of the week. xx is a string as in "Sunday" or "Monday", etc.
    <days_of_month><dom day="xx"/><days_of_month/> Day of the month. xx is an integer between 0 and 31, with 0 being the last day of the month.
  • object_updated

    To ensure that you are not over-writing another user's changes, run dbcloudcmd -v describe task to get the time the cloud was last modified. Specify this value as the object_updated parameter. If the cloud has been altered since the specified time, then the task fails with an error. If this occurs, run the task again after re-running dbcloudcmd -v describe task.

Example

Run the following task, all on one line, to alter the schedule mydatabaseschedule that runs the StartDatabaseCopy task on the database named mytenant3, to run every Sunday at 6:00 PM:

dbcloudcmd run AlterSchedule schedule_id=mydatabaseschedule taskdefinition=StartDatabaseCopy arguments=
"<args><a name=\"databasecopy\">mytenant3@\"my-server#3\"</a></args>" schedule_definition=
"<schedule><time_range start_time=\"18:00:00\"/><dow day=\"Sunday\"/></schedule>"

Run the following task to alter the schedule mydatabaseschedule, that runs the StopDatabase task on the database named mytenant3, to run every Wednesday at 4:00 PM, even if there are active connections.

call DBCloud.AlterSchedule( 
      schedule_id='mydatabaseschedule'
    , arguments='<args><a name="database_list">mytenant3</a><a name="unconditionally">1</a></args>'
    , schedule_definition='
    <schedule>
      <time_range start_time="16:00:00"/>
      <start_date date="2011-09-08"/>
      <days_of_week>
        <dow day="Wednesday"/>
      </days_of_week>
    </schedule>'
)

Example

The following schedule definition runs the associated task at 4:00 PM on the first day of each month, the fifteenth day of each month, and the last day of each month.

<schedule>
    <time_range start_time="16:00:00"/>
    <days_of_month>
        <dom day="1"/>
        <dom day="15"/>
        <dom day="0"/>
    </days_of_month>
</schedule>

Example

The following schedule definition runs the associated task at 4:00 PM on the Mondays and Fridays of each week.

<schedule>
    <time_range start_time="16:00:00"/>
    <days_of_week>
        <dow day="Monday"/>
        <dow day="Friday"/>
    </days_of_week>
</schedule>