PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Necessary rights
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Adds a scheduled task on a 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).
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 22 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 22
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
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_TASKS.FIC")
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 a hScheduledTask variable Hide the details

<Result> = HAddTask(<Connection Name> , <Name of Scheduled Task>)
<Result>: Integer
  • Identifier of scheduled task,
  • -1 if an error occurred. HErrorInfo is used to identify the error.
<Connection Name>: Character string (with or without quotes)
Name of connection for which a task will be added. This connection was defined in the data model editor, or by HDescribeConnection or HOpenConnection.
<Name of Scheduled Task>: Advanced hScheduleTask type
Name of hScheduledTask variable used

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

<Result> = HAddTask(<Connection Name> , <Name of 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 Name>: Character string (with or without quotes)
Name of connection for which a task will be added. This connection was defined in the data model editor, or by HDescribeConnection or HOpenConnection.
<Name of Stored Procedure>: Character string (with quotes)
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. For a backup, the parameters to pass are the ones of HBackup, except for the connection.
<Parameter N>: Type of optional parameter
Parameter that will be passed to the stored procedure. For a backup, the parameters to pass are the ones of HBackup, except for the connection.
Remarks

Necessary rights

To add a task, you must have:
  • the corresponding rights (hRightsManageTask constant) on the server,
  • Versions 23 and later
    the rights to connect (hRightsConnection or hRightsEncryptedConnection) to each relevant database,
    New in version 23
    the rights to connect (hRightsConnection or hRightsEncryptedConnection) to each relevant database,
    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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Linux wd230hf.so
Minimum required version
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment