|
|
|
|
|
- Overview
- Modifying the content of a query run WITH the hWithFilter constant
- Modifying the content of a query run WITHOUT the hWithFilter constant
Modifying the query content
Not available with this kind of connection
The queries are used to easily select the records coming from one or more data files, matching one or more selection criteria. Whether your query is created with the query editor or through programming, the records selected by the query can be directly modified when browsing the result of the query. This modification can be performed: - in the result of the query (HFSQL data file).
- either in the query result and in the query's database data files:
- Data files handled by OLE DB or a Native Connector: this modification is made automatically.
- HFSQL data files:
- Query executed with constant hWithFilter the data file is automatically modified.
- Query executed without constant hWithFilter constant must be used. hModifiesFile is required when executing the query with functions HExecuteQuery and HExecuteSQLQuery.
Changes made in the query are transferred to the database file only for the fields modified in the query. Modifying the content of a query run WITH the hWithFilter constant Several functions are used to modify the query result. In any case, the modification is directly performed on the base data file of the query. | | | Function | Feature | Limits/Possibilities |
---|
HAdd | Adds the record found in memory into the data file. | - Can only be used for single-file requests.
- The calculated items specified during the addition are ignored. They are automatically calculated.
| HWrite | Writes a record into a data file without updating the indexes corresponding to all keys used in the data file. | | HModify | Modifies the specified record or the record in memory in the data file. | - Only the modification of the current record is allowed.
- If the function is run to modify a query based on several data files, the modification is applied to the linked data files.
- A WLanguage error occurs when the content of a calculated item is modified. The content of these items is automatically calculated when modifying the record.
| HCross | Crosses a record in a data file. The record is deleted logically and it can be retrieved if necessary. | - Can only be used for single-file requests.
| HDelete | Deletes a record from a data file. The record is deleted logically and physically. It cannot be restored (unlike the records crossed by HCross). | - Can only be used for single-file requests.
|
Caution: - No modification can be performed on a query that uses the groups or the aggregates.
- Integrity and duplicates are not managed by operations on multi-file queries: it is advisable to use transactions to avoid any problems.
Modifying the content of a query run WITHOUT the hWithFilter constant Several functions are used to modify the query result. You have the ability to modify the query result or the data files taking part in the query ( hModifyFile constant specified in HExecuteQuery and HExecuteSQLQuery). | | | Function | Feature | Limits/Possibilities |
---|
HAdd | Adds the record found in memory into the data file. | - Can only be used for single-file requests.
- The calculated items specified during the addition are ignored. They are automatically calculated.
| HWrite | Writes a record into a data file without updating the indexes corresponding to all keys used in the data file. | | HModify | Modifies the specified record or the record in memory in the data file. | - If the function is run to modify a query based on several data files, the modification is applied to the linked data files.
- If the modified record does no longer correspond to the query selection, the record will still be found in the result of the query
- A WLanguage error occurs when the content of a calculated item is modified. The content of these items is automatically calculated when modifying the record.
| HCross | Crosses a record in a data file. The record is deleted logically and it can be retrieved if necessary. | - Can only be used for single-file requests.
| HDelete | Deletes a record from a data file. The record is deleted logically and physically. It cannot be restored (unlike the records crossed by HCross). | - Can only be used for single-file requests.
| Caution: - No modification can be performed on a query that uses the groups or the aggregates.
- Integrity and duplicates are not managed by operations on multi-file queries: it is advisable to use transactions to avoid any problems.
- On non-HFSQL data files, the constant hModifyFile constant is unnecessary: when the query result is modified, the data files contributing to the query are automatically modified.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|