|
|
|
|
|
- Modifying a composite key
- Handling errors
Component (Property) In french: Composante
Available only with these kinds of connection
The Component property configures the different components of a composite key. You can: - Get the Nth component of a composite key (defined in the data model editor or programmatically).
- Define the Nth component of a composite key (Item Description variable).
// Define the second component of the composite key LastFirstName.Component[2] = MaidenName ... // Validate the data file description HDescribeFile(Customer)
Syntax
Getting the Nth component of a composite key Hide the details
<Component name> = <Data file>.<Item>.Component[<N>]
<Component name>: Character string Name of the item corresponding to the sought component of the composite key. If N = 1 and if <Item> corresponds to a simple key, <Result> corresponds to the key name. <Data file>: Character string Name of the data file used. This name was defined in the data model editor or with the File Description type. <Item>: Character string Name of the key item used. This name was defined in the data model editor or with the Item Description type. <N>: Integer Number of the component whose name you want to get. The number of elements in a composite key is returned by the NbComponent property.
Defining the Nth component of a composite key Hide the details
<Item>.Component[<N>] = <New component name>
<Item>: Character string Name of the key item used. This name was defined by the Item Description type. <N>: Integer Number of the component to be modified or added. The number of elements in a composite key is returned by the NbComponent property. <New component name>: Character string Name of the item to be used as component of the composite key. Remarks Modifying a composite key By modifying the composite key, new components can be added to the composite key when it is described programmatically. This means that the different components defined must be numbered in ascending order and that there must be no "gaps" (for example, it is not possible to go from component 4 to component 6). Otherwise, a WLanguage error occurs. Remark: It is recommended to use the KeyExpression property to build a composite key in the code. Handling errors A fatal error (WLanguage error) occurs in the following cases: - the component to be read is greater than the number of components in the key,
- attempt to write a component that does not immediately follow the last component of the composite key.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|