AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / HFSQL / Tipos de variables HFSQL
  • Properties specific to hScheduledTask variables
  • How to handle the parameters passed to the stored procedure
  • Functions that use hScheduledTask variables
  • Compatibility
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
hScheduledTask (Variable type)
 
HFSQL ClassicHFSQL Client/ServerDisponible solo con estos tipos de conexión
The hScheduledTask type is used to manage a scheduled HFSQL Client/Server task programmatically. You can define and change the characteristics of this schedule task using several WLanguage properties.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Ejemplo
MyTask is hScheduledTask
MyTask.Description = "Scheduled backup"
MyTask.Month = "*"
MyTask.DayOfWeek = "*"
MyTask.DayOfMonth = "*"
MyTime is Time
MyTime = EDT_Time
MyTask.Hour = MyTime.Hour
MyTask.Minute = MyTime.Minute
MyTask.NumberExecution = 1
MyTask.Procedure = "HBackup"
Add(MyTask.Parameter, NameCSDatabase + "/LOG_TASKSFIC")
Add(MyTask.Parameter, NameCSDatabase + ".ScheduledBackup")
Add(MyTask.Parameter, True)
Add(MyTask.Parameter, MyTask.Description)
nID is int = HAddTask(CSConnection, MyTask)
Propiedades

Properties specific to hScheduledTask variables

The following properties can be used to define the characteristics of hScheduledTask variables:
Property nameType usedEffect
AtStartInteger constantIndicates whether the task must be done when starting the HFSQL server as well as its execution mode:
  • hBlocking: The task is blocking. The HFSQL server will not be accessible during the task execution.
  • hBottomTask: Task is not blocking. The HFSQL server will be accessible during the task execution. The task is run in background task.
  • No The task must not be executed at server startup (default value).
DayOfMonthCharacter stringNumber of the day for which the scheduled task must be run ("31" for example). This number is included between 0 and 31.
This parameter can also correspond to:
  • a comma-separated list of numbers: to specify several months.
  • an interval. For example, "9-13" (the task is scheduled from the 9th to the 13th of the month).
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task on every even day of the month.
DayOfMonthOrDayOfWeekBooleanManaged the execution of a scheduled task by specifying the day number of the week or day number of the month. Example: execution every Monday, 1st day of the month.
This property can correspond to:
  • True to run the scheduled task every Monday AND the first day of the month (cumulated conditions).
  • False to run the task on Monday 1st (exclusive conditions).
DayOfWeekCharacter stringNumber of the day for which the scheduled task must be run ("2" for example). This number is included between 1 and 7 (1 = Monday, 2 = Tuesday, ...).
This parameter can also correspond to:
  • a comma-separated list of numbers: to specify several days.
  • an interval. For example, "1-3" (the task is scheduled for Monday, Tuesday and Wednesday).
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task on every even day of the week.
  • the day of the week in letters ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday").
Description (*)Character stringDescription associated with the scheduled task. The description of scheduled task corresponds to an empty string by default.
This property is optional.
EnabledBoolean
  • True if the task scheduling is enabled,
  • False otherwise.
HourCharacter string
Execution time of scheduled task. If TimeUTC is set to True, this time will be in UTC.The possible values are:
  • a digit included between 0 and 23.
  • a comma-separated list of numbers: to specify several hours.
  • an interval. For example, "9-13".
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task at every even hour.
MinuteCharacter string
Minutes of the execution time of the scheduled task. If TimeUTC is set to True, this time will be in UTC.
The possible values are:
  • a digit included between 0 and 59.
  • a comma-separated list of numbers: to specify several minutes.
  • an interval. For example, "9-13".
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task at every even minute.
MonthCharacter stringNumber of the execution month of scheduled task ("11" for example). The possible values are:
  • a digit included between 1 and 12.
  • a comma-separated list of numbers: to specify several months.
  • an interval. For example, "9-11".
  • a star ("*") to specify the entire range.
  • an interval with a step, "*/2" for example to perform the task on every even month.
NumberExecutionIntegerNumber of times the task must be run. This property can also correspond to the Infinite constant.
ParameterArrayParameters of the stored procedure that will be run by the scheduled task. For more details, see "How to handle the parameters passed to the stored procedure?".
ProcedureCharacter stringName of the stored procedure that will be run by the scheduled task.
This property is of the form: <Nom de la base>:<Nom de la collection de procédures>.<Nom de la procédure stockée>.
To perform a backup, this property must correspond to "HBackup".
TimeUTCBoolean
  • True (default value) if the time is in UTC (Hour and Minute properties),
  • False otherwise.
UserCharacter stringUser who created the scheduled task.
This property is read-only.
The properties followed by a star (*) are optional.
Observaciones

How to handle the parameters passed to the stored procedure

The Parameter property of the hScheduledTask variable is an array of strings.
To define the parameters of a stored procedure when triggering a scheduled task, use Add or ArrayAdd. Example:
Add(MyTask.Parameter, gsNameCSDatabase + ".ScheduledBackup")
To handle the parameters, the FOR EACH syntax allows you to browse an array.
To find out the number of array elements, you can use:

Functions that use hScheduledTask variables

HAddSchedulingAdds a new scheduled item to an HFSQL server: scheduled task (stored procedure), backup, optimization or refresh of a materialized view.
HAddTaskAdds a scheduled task on the server defined by the connection.
HDeleteSchedulingDelete a scheduled item on an HFSQL server: scheduled task (stored procedure), backup, optimization, refresh of a materialized view.
Novedad versión 2025
HDeleteSchedulingHistory
Elimina el historial de ejecución de un trabajo programado en un servidor HFSQL. Este trabajo puede ser una tarea programada (procedimiento almacenado), una copia de seguridad, una optimización o una actualización de vista materializada.
HExecuteSchedulingImmediately executes a scheduled item regardless of its scheduling: scheduled task (stored procedure), backup, optimization, refresh of a materialized view.
HInfoTaskReturns the characteristics of a scheduled task in a hScheduledTask variable].
Novedad versión 2025
HListSchedulingHistory
Obtiene el historial de ejecución de un trabajo programado en un servidor HFSQL. Este trabajo puede ser una tarea programada (procedimiento almacenado), copia de seguridad, optimización o actualización de una vista materializada.
HModifySchedulingModify a scheduled item on an HFSQL server: scheduled task (stored procedure), backup, optimization, refresh of a materialized view.
HModifyTaskModifies a scheduled task on the HFSQL server defined by the connection.

Compatibility

The hScheduledTask type replaces the global hScheduledTask structure available in version 12. This structure is kept for backward compatibility.
Versión mínima requerida
  • Versión 14
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local