ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Managing databases / HFSQL / HFSQL Client/Server functions
  • Necessary rights
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Adds a scheduled task on an HFSQL server.
Compatibility with version 12: For backward compatibility with version 12, you also have the ability to define a task via the HScheduledTask structure. This task will run the specified stored procedure (or will perform a database backup).
Example
MyTask is hScheduledTask
MyTask.Description = "Scheduled backup " + CR + ...
	DateToString(DateSys(), maskSystemDate) + " at "+ TimeToString(TimeSys(), "HH:MM:SS")
MyTask.Month = "*"
MyTask.DayOfWeek = "*"
MyTask.DayOfMonth = "*"
MyTask.Hour = EDT_Time.Hour
MyTask.Minute = EDT_Time.Minute
MyTask.NumberExecution = 1
MyTask.Procedure = "HBackup"
Add(MyTask.Parameter, gsNameCSDatabase + "/LOG_TASKSFIC")
Add(MyTask.Parameter, gsNameCSDatabase + ".ScheduledBackup")
Add(MyTask.Parameter, True)
Add(MyTask.Parameter, MyTask.Description)
nID is int = HAddTask(gsCSConnection, MyTask)
Syntax

Creating a task from an hScheduledTask variable Hide the details

<Result> = HAddTask(<Connection> , <Scheduled task>)
<Result>: Integer
  • Identifier of scheduled task,
  • -1 if an error occurred. HErrorInfo is used to identify the error.
<Connection>: Character string or Connection variable
Connection for which a task must be added. This connection corresponds to:
<Scheduled task>: hScheduledTask variable
Name of the hScheduledTask variable used.

Creating a task from the hScheduledTask structure (compatibility with version 12) Hide the details

<Result> = HAddTask(<Connection> , <Stored procedure> [, <Parameter 1> [... [, <Parameter N>]]])
<Result>: Character string
  • Identifier of scheduled task,
  • -1 if an error occurred. HErrorInfo is used to identify the error.
<Connection>: Character string or Connection variable
Connection for which a task must be added. This connection corresponds to:
<Stored procedure>: WLanguage procedure
Name of WLanguage stored procedure that will be run when triggering the task. This parameter has the following format: "<Database name>\<Name of stored procedure>". If this name corresponds to "HBackup", the scheduled task will perform a backup.
<Parameter 1>: Type of optional parameter
Parameter that will be passed to the stored procedure. In the case of a backup, the parameters to be passed are those of HBackup, except for the connection.
<Parameter N>: Type of optional parameter
Parameter that will be passed to the stored procedure. In the case of a backup, the parameters to be passed are those of HBackup, except for the connection.
Remarks

Necessary rights

To add a task, you must have:
  • the corresponding rights (hRightsManageTask constant) on the server,
  • the rights to connect (hRightsConnection or hRightsEncryptedConnection) to each relevant database,
  • the rights to run the command linked to the scheduled task.
The task will be run with the account of user who created the task.
Caution: The scheduled task will not be performed if the server is switched off. The scheduled task will be performed at the next available date when the server is switched on.
Component: wd300hf.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/06/2024

Send a report | Local help