PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

  • Overview
  • Modifying the content of a query run WITH the hWithFilter constant
  • Modifying the content of a query run WITHOUT the hWithFilter constant
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
Modifying the query content
ODBCNot available with this kind of connection
Overview
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 by 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).
  • in the result of the query and in the base files of the query:
    • Files accessed by OLEDB or by a Native Access: this modification is automatically performed.
    • HFSQL files:
      • Query run with the hWithFilter constant: The data file is automatically modified.
      • Query run without the hWithFilter constant: The hModifyFile constant must be used when the query is run by HExecuteQuery and HExecuteSQLQuery.
The modifications performed on the base file in the query are only applied to the items modified in the query.
Note: From version 19, HFSQL is the new name of HyperFileSQL.
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.
FunctionFeatureLimits/Possibilities
HAddAdds the record found in memory into the data file.
  • Can only be used on the single-file queries.
  • The calculated items specified during the addition are ignored. They are automatically calculated.
HWriteWrites a record into a data file without updating the indexes corresponding to all keys used in the file.
HModifyModifies the specified record or the record found 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 files, the modification is applied to the linked 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.
HCrossCrosses a file record. The record is deleted logically and it can be retrieved if necessary.
  • Can only be used on the single-file queries.
HDeleteDeletes a record from a file. The record is deleted logically and physically. It cannot be restored (unlike the records crossed by HCross).
  • Can only be used on the single-file queries.
Caution:
  • No modification can be performed on a query that is using the groups or the aggregates.
  • The management of integrity and duplicates is not performed during the operations on the multi-file queries: we recommend that you use the transactions to avoid any problem.
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).
FunctionFeatureLimits/Possibilities
HAddAdds the record found in memory into the data file.
  • Can only be used on the single-file queries.
  • The calculated items specified during the addition are ignored. They are automatically calculated.
HWriteWrites a record into a data file without updating the indexes corresponding to all keys used in the file.
  • Unusable.
HModifyModifies the specified record or the record found in memory in the data file.
  • If the function is run to modify a query based on several files, the modification is applied to the linked 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.
HCrossCrosses a file record. The record is deleted logically and it can be retrieved if necessary.
  • Can only be used on the single-file queries.
HDeleteDeletes a record from a file. The record is deleted logically and physically. It cannot be restored (unlike the records crossed by HCross).
  • Can only be used on the single-file queries.
Caution:
  • No modification can be performed on a query that is using the groups or the aggregates.
  • The management of integrity and duplicates is not performed during the operations on the multi-file queries: we recommend that you use the transactions to avoid any problem.
  • On files in a format other than HFSQL, the hModifyFile constant is useless: when modifying the result of the query, the files involved in the query are automatically modified.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment