|
|
|
|
|
- Overview
- Several physical data files with an identical logical description
- Several logical data files linked to a single physical data file
- Handling the aliases programmatically
- The WLanguage functions
- Create an alias on what?
- Characteristics of an alias
- Handling the alias file and its items
- Triggers and aliases
Aliases on data files: HAlias function
 Available only with these kinds of connection
The aliases are used to handle: - Several physical data files with the same description in the analysis
- Several logical data files described in the analysis that handle the same physical data file.
Please note: This help page describes how to create an alias using the HAlias function. Starting with version 27, you can use Alias variables. This type of variable makes it easier to create and handle aliases.
Several physical data files with an identical logical description For example: You can manipulate: - The Customer2000.fic file that contains the backup of the customers for the year 2000
- The Customer.fic file that contains the customer references for the current year
These two data files have the same logical description in the analysis: the CLIENT file. By default, the description of the CUSTOMER file in the analysis is linked to the Customer.fic file.
To use the Client2000.Fic data file, you need to "copy" the description of the CLIENT data file from the analysis: simply create an alias using the HAlias function. The corresponding line of code is as follows: HAlias(Customer, Customer2000)
The two files will be handled the same way with the HFSQL functions. Several logical data files linked to a single physical data file You have the ability to perform several parallel searches on the same physical data file or a search and a filter in parallel on the data file. Example: The data file Client.Fic is associated with the logical file Client in the analysis.. To filter the records found in the Customer.fic data file and to browse at the same time all the records found in this data file, you must: - From "copying" the description of the CLIENT data file into the analysis: simply create an alias with the function HAlias.
- Associate the description of the alias with the physical data file named Customer.Fic (HChangeName).
Note: This method allows you to manage multiple HFSQL contexts for the same physical data file. Handling the aliases programmatically The WLanguage functions Several functions are used to handle the aliases:
| | HAlias | Creates a logical alias of a data file (or query) or cancels all existing aliases. | HCancelAlias | Cancels an alias that was declared beforehand by HAlias. |
Other functions can intervene in the definition and use of aliases:
| | HChangeDir | Changes the path to a data file (i.e. directory in which the file will be handled). | HChangeName | Modifies the physical name of a data file. |
Note: Variables of type Alias simplify the creation and manipulation of aliases. Create an alias on what? You have the ability to create and handle aliases for the following elements: - Data file described in the analysis,
- Data file described dynamically,
- Query created in the query editor,
- HFSQL Classic view,
- Alias.
Characteristics of an alias - Physical data file associated with an alias:
By default, the name specified for the alias is assigned to the physical data file corresponding to the alias. To associate the alias with a physical data file of different name, you must use HChangeName and HChangeDir. - Password of an alias:
By default, the password of an alias file is identical to the password of the source data file. This password can be changed using HPass. The name of the data file used in this function corresponds to the name of the alias. - Re-indexing:
The alias files can be re-indexed. - Automatic modification of data files:
This operation can be applied to the alias files.
Handling the alias file and its items - Code editor To avoid the "Unknown identifier" error when using an alias file and its fields, it is necessary to define a data source to declare the alias name before using the HAlias function.
For example:
Orders2000 is Data Source
HAlias(Orders, Orders2000)
Warning: using the External keyword is possible, but will result in a significant slowdown at runtime. - Window or page editor Fields and tables cannot be directly associated with alias file fields. The controls must be assigned one by one programmatically.
Note: to programmatically redefine field links, you can use either the ControlAlias function or the DataBinding property.
Triggers and aliases Triggers can be defined on data file aliases.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|