ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Deleting records from a query
  • Deleting records from an HFSQL view
  • Deleting records from a transaction
  • Benefits compared to a loop for deleting records
  • Advantage compared to .Creation
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
<Source>.DeleteAll (Function)
In french: <Source>.SupprimeTout
ODBCNot available with this kind of connection
Deletes all records from a data file, an HFSQL view or a query. The records are deleted logically and physically. They cannot be restored.
The following operations are performed:
  • records are deleted: records are no longer referenced in the index. The data is not kept.
  • the indexes (corresponding to the keys of the records) are deleted from the index file.
  • the memos associated with the records are deleted from the memo file.
  • the automatic identifiers are reinitialized.
Warning: integrity is not checked.
WINDEV, WINDEV Mobile and WEBDEV offer automatic error handling for the following 5 types of error: Duplicate error, Integrity error, Password error, Modification conflict and status error during modification conflict, Blocking error. For more details, see HFSQL error handling help.
Example
// Vide le fichier de données sans le recréer
Client.SupprimeTout()
Syntax
<Result> = <Source>.DeleteAll()
<Result>: Boolean
  • True if the records have been deleted,
  • False if a problem occurred (locked record, record in transaction, ...). HErrorInfo is used to identify the error.
<Source>: Type corresponding to the specified source
Name of HFSQL data file, HFSQL view or query used.
Remarks

Deleting records from a query

If the query was created by using the hModifyFile constant, <Source>.DeleteAll deletes the records from the source of the query.

Deleting records from an HFSQL view

<Source>.DeleteAll deletes the records from the view but it does not delete the records from the data file used for the view.

Deleting records from a transaction

<Source>.DeleteAll does not delete the records found in a transaction (canceled or validated).

Benefits compared to a loop for deleting records

To delete the records from a data file, you can also set a loop for deleting the records (<Source>.Delete). For example:
FOR EACH NumCli OF Commande
	Commande.Supprime()
END
Using <Source>.DeleteAll has the following advantages:
  • the process is faster,
  • the size of empty data file is smaller.

Advantage compared to <Source>.Creation

To delete the records from a data file, you also have the ability to use <Source>.Creation.
Using <Source>.DeleteAll has the following advantages:
  • Deletion possible even if users are connected to the data file.
  • Automatic management of HFSQL errors.
Component: wd300hf.dll
Minimum version required
  • Version 25
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help