Help / WLanguage / Managing databases / HFSQL / HFSQL Client/Server functions
  • Necessary rights
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Adds an optimization task of HFSQL Client/Server data files.
// Recalculate the statistics for the files found in "MyDatabase", 
// every Saturday at 23:00
Optim is hScheduledOptimization
Optim.Description = "Recalculating the statistics for the files found in the MyDatabase database"
Optim.Scheduling.Month = "*"
Optim.Scheduling.DayOfWeek = "Saturday"
Optim.Scheduling.Hour = "23"
Optim.Scheduling.Minute = "0"
Optim.File[1].Name = "MyDatabase"
Optim.File[1].Option = hOptStat
HAddScheduledOptimization(MyConnection, Optim)
<Result> = HAddScheduledOptimization(<Connection> , <Scheduled optimization task>)
<Result>: Boolean
  • True if the scheduled optimization task was added
  • False if an error occurred. HErrorInfo is used to identify the error.
<Connection>: Character string or Connection variable
Connection for which a scheduled optimization task will be added. This connection corresponds to:
<Scheduled optimization task>: hScheduledOptimization variable
Name of the hScheduledOptimization variable used.

Necessary rights

To add a scheduled optimization 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 optimization task.
The task will be run with the account of user who created the task.
For a full server optimization, the user must be a super-user.
Remark: The schedule optimization task will not be performed if the server is switched off. The scheduled optimization task will be performed at the next available date when the server is switched on.
To find out whether these rights are granted to a user or to a group, use HInfoServerRights or HInfoDatabaseRights.
To modify the rights granted to a user or group of users, use HModifyServerRights or HModifyDatabaseRights.
Component: wd300hf.dll
Minimum version required
  • Version 15
This page is also available for…
Click [Add] to post a comment

Last update: 06/06/2024

Send a report | Local help