PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • WLanguage properties that can be used with the hBackupDescription type
  • Operating mode for the limit regarding the number of backups (..LimitNumberBackups property)
  • Parameters of the stored procedure called BEFORE the backup
  • Parameters of the stored procedure called AFTER the backup
  • Functions that use the hBackupDescription variables:
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
hBackupDescription (Type of variable)
In French: hDescriptionSauvegarde (Type de variable)
HFSQL Client/ServerAvailable only with this kind of connection
The hBackupDescription type is used to describe a HFSQL Client/Server backup by programming.
This backup can be performed immediately or it can be scheduled.
The characteristics of this backup can be defined and modified by several WLanguage properties.
Note: See Declaring a variable for more details.
Versions 17 and later
iPhone/iPad This type of variable is now available for the iPhone and iPad applications.
New in version 17
iPhone/iPad This type of variable is now available for the iPhone and iPad applications.
iPhone/iPad This type of variable is now available for the iPhone and iPad applications.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Example
// Describe an immediate backup
Backup_Doc is hBackupDescription
Backup_Doc..Description = "Doc Backup"
Backup_Doc..WithIndex = True
Backup_Doc..ProgressBar = "PROGBAR_MyProgressBar"
Backup_Doc..Destination = "Doc/Backup"
Backup_Doc..Source = "Doc/*"
Backup_Doc..ProcedureBefore = "mydatabase:DocCol.Check"
Backup_Doc..ProcedureAfter = "mydatabase:DocCol.CheckBackup"
Backup_Doc..LimitNumberBackups = 5
// Save the backup
HBackup(MyConnection, Backup_Doc)
// Create a scheduled backup every 5 minutes
// with a differential backup every minute
hBck is hBackupDescription
hBck..Enabled = True
hBck..WithIndex = True
hBck..Description = "Scheduled backup every N minutes " + ...
" with a differential backup every minute on the database "+ cnt..Database + ...
" created on "+ DateToString(DateSys(), maskSystemDate) + ...
" at " + TimeToString(TimeSys(), "HH:MM:SS:CC")
hBck..Destination = "Backup_"+ cnt..Database
hBck..LimitNumberBackups = 2
hBck..Source = cnt..Database
hBck..SchedulingFull..Month = "*"
hBck..SchedulingFull..DayOfMonth = "*"
// Define the scheduling
dtServerDateTime is DateTime = HInfoServer(cnt, hInfoDate)
dtServerDateTime..Minute++
hBck..SchedulingFull..Hour = dtServerDateTime..Hour
hBck..SchedulingFull..Minute = dtServerDateTime..Minute
hBck..SchedulingFull..DayOfWeek = "*"
hBck..SchedulingFull..DayOfMonthOrDayOfWeek = False
hBck..SchedulingDifferential..Month = "*"
hBck..SchedulingDifferential..DayOfMonth = "*"
hBck..SchedulingDifferential..Hour = "*"
hBck..SchedulingDifferential..Minute = "*"
hBck..SchedulingDifferential..DayOfWeek = "*"
hBck..SchedulingDifferential..DayOfMonthOrDayOfWeek = False

// Add the scheduled backup
IF HAddScheduledBackup(cnt, hBck) = False THEN
Error("Failure creating the scheduled backup", HErrorInfo(hErrFullDetails))
RETURN
END
Remarks

WLanguage properties that can be used with the hBackupDescription type

The following properties can be used to handle a hBackupDescription variable.
NameType usedEffect
Versions 15 and later
Enabled
New in version 15
Enabled
Enabled
BooleanUsed to manage the activation of a scheduled backup:
  • True if the backup scheduling is enabled: the backup is performed according to the scheduling.
  • False if the backup scheduling is not enabled: the backup is not performed.
WithIndexBoolean
  • True if the backup of indexes must be performed,
  • False otherwise.
This property is optional.
The indexes are saved by default.
Versions 18 and later
Compression
New in version 18
Compression
Compression
Integer constantUsed to compress (or not) the result of backup. This property can correspond to one of the following constants:
  • zipFormatNone: No compression.
  • zipFormatZIP: Compression in Zip format.
DescriptionCharacter stringDescription associated with the backup.
This property is optional.
The backup description corresponds to an empty string ("") by default.
DestinationCharacter stringDestination of the backup (name and destination of the backup).
The backup will be preformed on the server, in a location defined by this name.
If this name corresponds to a relative path, the backup will be placed in the "Backup" sub-directory of the HFSQL server.
To specify:
  • the directory of the Manta service, use the "%%EXE%%" character string.
  • the year, use the "%%YEAR%%" character string (2008 for example).
  • the month on 2 digits, use the "%%MONTH%%" character string (03 for example).
  • the day, use the "%%DAY%%" character string.
  • the hour, use the "%%HOUR%%" character string.
  • the minutes, use the "%%MINUTE%%" character string.
Versions 15 and later
Identifier
New in version 15
Identifier
Identifier
IntegerIdentifier of the backup.
This property is available in read-only.
ProgressBarControl nameName of the Progress Bar control used in the window to view the progress of the initialization step of the backup (and not the progress of the backup).
Optional property available in WINDEV only.
LimitNumberBackupsIntegerMaximum number of backups of the same type to perform. There is no limit if this number corresponds to 0.
If the number of backups exceeds the limit value, some former backups will be removed from the server.
See "Operating mode for the limit regarding the number of backups" for more details.
Versions 15 and later
SchedulingFull
New in version 15
SchedulingFull
SchedulingFull
hScheduling variableCharacteristics of a full scheduling. This property must necessarily be specified.
Versions 15 and later
SchedulingDifferential
New in version 15
SchedulingDifferential
SchedulingDifferential
hScheduling variableCharacteristics of a differential scheduling. You have the ability to define both a full scheduling and a differential scheduling. No differential scheduling can be performed on its own.
This property is optional.
ProcedureAfterCharacter stringName of the stored procedure used after the execution of the backup.
The procedure name has the following format: <Database Name>:<Name of Set of Procedures>.<Name of Stored Procedure>.

This property is optional.
No procedure is run if this property is not defined.

See "Parameters of the stored procedure called AFTER the backup" for more details.
ProcedureBeforeCharacter stringName of the stored procedure used before the execution of the backup.
The procedure name has the following format: <Database Name>:<Name of Set of Procedures>.<Name of Stored Procedure>.

This property is optional.
No procedure is run if this property is not defined.

See "Parameters of the stored procedure called BEFORE the backup" for more details.
Source (*)Character stringFilter used to define the data to save. The possible values are:
  • *: Saves all the databases found on the server, the logs, the system databases (users, groups, rights).
  • Database Name/*: Saves the entire database: files, links, stored procedures, triggers.
  • Database Name/Name of File1: Saves <Name of File1> found in <Database Name>.
  • Name of Database 1/Name of File1 + TAB + Name of Database 2/Name of File2 + ...: List of elements to save. The separator can be the tabulation (TAB) or the semicolon (";").
  • System: Saves the system databases (users, groups, rights).
This property must necessarily be specified.
Versions 15 and later
User
New in version 15
User
User
Character stringUser who has created the backup.
This property is available in read-only.
Note: These properties can be used with one of the following syntaxes:
  • <Variable Name>..<Property Name>
  • <Variable Name>.<Property Name>
The properties followed by (*) are mandatory.

Operating mode for the limit regarding the number of backups (..LimitNumberBackups property)

When the limit regarding the number of backups is enabled (..LimitNumberBackups differs from 0):
  1. Before the backup: Search for the former similar backups (same source and same destination). If these backups are in error, the files of the backup will be erased from the disk (but the backup will remain in the history of backups).
  2. Running the "Before Procedure".
  3. Backup.
  4. Running the "After Procedure".
  5. If the number of similar backups (same source and same destination) successfully performed is greater than the limit value, the server will delete some of these backups and will remove them from the history. This deletion starts from the oldest backup until the number of backups is equal to the requested value.
Note: This property can be used to implement a specific backup system. For example:
  • A daily backup while storing the last 7 backups.
  • A weekly backup while storing the last 4 backups.
  • A monthly backup while storing the last 6 backups.

Parameters of the stored procedure called BEFORE the backup

The stored procedure called BEFORE the backup can take parameters. This procedure has the following format:
PROCEDURE <Procedure Name>(<Data to Save>, ...
<Backup Destination>, <Description>)
These parameters are optional. They will allow you to handle the following indications in the code of the stored procedure:
  • <Data to Save>: Character string corresponding to the information to save. Corresponds to ..Source. The possible values are as follows:
    *Saves all the databases found on the server, the logs, the system databases (users, groups, rights).
    Database Name/*Saves the entire database: files, links, stored procedures, triggers.
    Database Name/Name of File1Saves <Name of File1> found in <Database Name>.
    Name of Database 1/Name of File 1 + TAB + Name of Database 2/ Name of File 2 + ...List of elements to save. The separator can be the tabulation (TAB) or the semicolon (";").
    SystemSaves the system databases (users, groups, rights).
  • <Backup Destination>: Name and destination of the backup. Corresponds to ..Destination. The backup will be preformed on the server, in a location defined by this name. If this name corresponds to a relative path, the backup will be placed in the "Backup" sub-directory of the HFSQL server. To specify:
    • the directory of the Manta service, use the "%%EXE%%" character string.
    • the year, use the "%%YEAR%%" character string (2008 for example).
    • the month on 2 digits, use the "%%MONTH%%" character string (03 for example).
    • the day, use the "%%DAY%%" character string.
    • the hour, use the "%%HOUR%%" character string.
    • the minutes, use the "%%MINUTE%%" character string.
  • <Description>: Backup description. Corresponds to ..Description.

Parameters of the stored procedure called AFTER the backup

The stored procedure called AFTER the backup can take parameters. This procedure has the following format:
PROCEDURE <Procedure Name>(<Data to Save>, <Backup Destination>, ...
<Description>, <Status>, <Error Message>)
These parameters are optional. They will allow you to handle the following indications in the code of the stored procedure:
  • <Data to Save>: Character string corresponding to the information to save. Corresponds to ..Source. The possible values are as follows:
    *Saves all the databases found on the server, the logs, the system databases (users, groups, rights).
    Database Name/*Saves the entire database: files, links, stored procedures, triggers.
    Database Name/Name of File1Saves <Name of File1> found in <Database Name>.
    Name of Database 1/Name of File 1 + TAB + Name of Database 2/ Name of File 2 + ...List of elements to save. The separator can be the tabulation (TAB) or the semicolon (";").
    SystemSaves the system databases (users, groups, rights).
  • <Backup Destination>: Name and destination of the backup. Corresponds to ..Destination. The backup will be preformed on the server, in a location defined by this name. If this name corresponds to a relative path, the backup will be placed in the "Backup" sub-directory of the HFSQL server. To specify:
    • the directory of the Manta service, use the "%%EXE%%" character string.
    • the year, use the "%%YEAR%%" character string (2008 for example).
    • the month on 2 digits, use the "%%MONTH%%" character string (03 for example).
    • the day, use the "%%DAY%%" character string.
    • the hour, use the "%%HOUR%%" character string.
    • the minutes, use the "%%MINUTE%%" character string.
  • <Description>: Backup description. Corresponds to ..Description.
  • <Status>: integer (or Integer constant) used to find out the status of the backup:
    hBackupInProgress0Backup in progress
    hBackupCompleted1Backup completed
    hBackupCanceled2Backup canceled
    hBackupError3Error during backup
  • <Error Message>: Error message (if it exists) in character string format.

Functions that use the hBackupDescription variables:

Versions 15 and later
HAddScheduledBackup
New in version 15
HAddScheduledBackup
HAddScheduledBackup
Adds a scheduling for full backup (with or without differential backup) on the server defined by the connection.
Versions 12 and later
HBackup
New in version 12
HBackup
HBackup
Saves the content of a HFSQL server: all databases found on the server, one or more databases, one or more data files.
Versions 15 and later
HListScheduledBackup
New in version 15
HListScheduledBackup
HListScheduledBackup
Lists the full and differential backups that have been scheduled on a HFSQL Client/Server server.
Versions 15 and later
HModifyScheduledBackup
New in version 15
HModifyScheduledBackup
HModifyScheduledBackup
Modifies a backup scheduling.
Minimum required version
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment