PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Triggers of the same type
  • Trigger on the functions for handling the Table controls
  • Variables used to manage the triggers
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
HDescribeServerTrigger (Function)
In French: HDécritTriggerServeur
HFSQL Client/ServerAvailable only with this kind of connection
Adds or modifies a server trigger. A server trigger is a stored procedure automatically called by the HFSQL engine whenever a HFSQL function is run.
Note: The functions for handling the server triggers are advanced functions. The server triggers can be created directly in the data model editor. See Server triggers for more details.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
Versions 22 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
New in version 22
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
Example
// Create a data file
IF HCreation(Cedex) = False THEN
Error(HErrorInfo())
ELSE
Info("File created")
END

// Change the directory of the file
IF HChangeDir(Cedex, ".\FRANCE\") = False THEN Error(HErrorInfo())

// Create a trigger on a HFSQL Client/Server data file
IF HDescribeServerTrigger("CNT_TEST", "TriggerTEST", ...
"ProcedureTEST", hTriggerAfter, ...
"Cedex", "HAdd, HModify") = False THEN Error(HErrorInfo())
// Add records
Cedex.ZipCode = "30000"
Cedex.City = "NIMES"
HAdd(Cedex)

Cedex.ZipCode = "34000"
Cedex.City = "MONTPELLIER"
HAdd(Cedex)
Syntax

Describing a server trigger (logical files) Hide the details

<Result> = HDescribeServerTrigger(<Trigger Name> , <Name of Stored Procedure> , <Type of Trigger> , <Logical HFSQL Client/Server Files> [, <List of HFSQL Functions>])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HErrorInfo is used to identify the error.
<Trigger Name>: Character string (with quotes)
Name of the trigger to create. This name will be used to handle the trigger in the functions for managing the server triggers.
<Name of Stored Procedure>: Character string
Name of the WLanguage stored procedure that will be run when activating the trigger. This procedure accepts no parameter.
<Type of Trigger>: Integer constant
Indicates the type of trigger.
hTriggerBeforeThe stored procedure is run before the HFSQL function.
hTriggerAfterThe stored procedure is run after the HFSQL function.
<Logical HFSQL Client/Server Files>: Character string (with quotes)
Logical name of one or more HFSQL Client/Server data files. To specify several names, the names of the data files must be separated by a comma (", ").
<List of HFSQL Functions>: Optional character string (with quotes)
Name of one or more HFSQL or TableXXX functions on which the trigger must be implemented. To specify several names of functions, the names of functions must be separated by a comma (","). You have the ability to define triggers on the following functions:
The triggers are also run on the INSERT queries (trigger of HAdd), UPDATE queries (trigger of HModify) and DELETE queries (trigger of HDelete).

Describing a server trigger on the physical files associated with a connection Hide the details

<Result> = HDescribeServerTrigger(<Connection Name> , <Trigger Name> , <Name of Stored Procedure> , <Type of Trigger> [, <Physical HFSQL Client/Server Files> [, <List of HFSQL Functions>]])
<Result>: Boolean
  • True if the operation was performed,
  • False if a problem occurred. HError is used to identify the error.
<Connection Name>: Character string (with or without quotes)
Name of connection to use. This connection was defined in the data model editor, or by HDescribeConnection or HOpenConnection.
<Trigger Name>: Character string (with quotes)
Name of the trigger to create. This name will be used to handle the trigger in the functions for managing the server triggers.
<Name of Stored Procedure>: Character string
Name of the WLanguage stored procedure that will be run when activating the trigger. This procedure accepts no parameter.
<Type of Trigger>: Integer constant
Indicates the type of trigger.
hTriggerBeforeThe stored procedure is run before the HFSQL function
hTriggerAfterThe stored procedure is run after the HFSQL function
<Physical HFSQL Client/Server Files>: Optional character string (with quotes)
Physical name of one or more HFSQL Client/Server data files associated with the connection ("CUSTOMER.FIC" for example). To specify several names, the names of the data files must be separated by a comma (","). If this parameter is not specified or if it corresponds to an empty string (""), the trigger will be enabled on all the data files of the database.
<List of HFSQL Functions>: Optional character string (with quotes)
Name of one or more HFSQL or TableXXX functions on which the trigger must be implemented. To specify several names of functions, the names of functions must be separated by a comma (","). You have the ability to define triggers on the following functions:
The triggers are also run on the INSERT queries (trigger of HAdd), UPDATE queries (trigger of HModify) and DELETE queries (trigger of HDelete).
Remarks

Triggers of the same type

If several triggers of the same type are defined on the same data file for the same operation, these triggers will be run according to the alphabetical order of their names.

Trigger on the functions for handling the Table controls

The functions for handling the Table controls (TableAdd, TableAddLine, TableDelete, TableModify, ... ) implicitly use the following HFSQL functions: HAdd, HDelete and HModify.
When using one of these functions for handling the Table controls, if a trigger is defined for the corresponding HFSQL function, the trigger is automatically activated.

Variables used to manage the triggers

A trigger procedure accepts no parameter. However, some HFSQL state variables are positioned before each call:
H.FileNameCharacter string: Logical name of the data file whose trigger is activated.
H.ActionCharacter initialized to "A" for a Before trigger and to "P" for an After trigger.
H.TriggerFunctionCharacter string: Name of HFSQL function that activated the trigger.
H.ToDoDuring the execution of the Before trigger, the execution of the current HFSQL function can be canceled by assigning "A" to the HFSQL state variable: H.ToDo = "A"
Note: If a BEFORE trigger and an AFTER trigger are defined for a HFSQL function and if the BEFORE trigger cancels the function (H.ToDo is set to "A"), then the AFTER trigger is not activated.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230hf.dll
Windows Mobile wp230hf.dll
Java wd230java.jar
Linux wd230hf.so
Android wd230android.jar
Minimum required version
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment