ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL Client/Server functions
  • Necessary rights
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Adds a scheduled task on an HFSQL server.
Compatibility with version 12: For compatibility with version 12, it is also possible to define a task using the HScheduledTask structure.. This task will run the specified stored procedure (or will perform a database backup).
To define a scheduled element (scheduled task, backup, optimization, or refresh of a materialized view, it is recommended to use the function HAddScheduling.
Example
MaTâche is hScheduledTask
MaTâche.Description = "Sauvegarde planifiée " + CR + ...
	DateToString(DateSys(), maskDateSystem) + " à " + TimeToString(TimeSys(), "HH:MM:SS")
MaTâche.Month = "*"
MaTâche.DayOfWeek = "*"
MaTâche.DayOfMonth = "*"
MaTâche.Hour = SAI_Heure.Heure
MaTâche.Minute = SAI_Heure.Minute
MaTâche.NumberExecution = 1
MaTâche.Procedure = "HBackup"
Add(MaTâche.Parameter, gsNomBaseCS + "/LOG_TACHES.FIC")
Add(MaTâche.Parameter, gsNomBaseCS + ".SauvegardePlanifiée")
Add(MaTâche.Parameter, True)
Add(MaTâche.Parameter, MaTâche.Description)
nID is int = HAddTask(gsConnexionCS, MaTâche)
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 right (constant hTaskManagerRight) 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: If the server is switched off, the scheduled task will not be performed.. 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/12/2025

Send a report | Local help