PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

WinDevWebDev - Server codeWebDev - Browser codeWinDev MobileReports and QueriesWindowsLinuxWindows MobileWindows PhoneWindows Store appsAndroidAndroid Widget iPhone/iPadJavaPHPAjaxUser code (UMC)External languageHFSQLHFSQL Client/ServerStored proceduresHyper File 5.5OLE DBODBCNative Accesses

HDeleteAll (Function)
In French: HSupprimeTout

Deletes all the records from a data file, from a HFSQL view or from a query. The records are deleted logically and physically. They cannot be restored.

The following operations are performed:

  • the records are deleted: the records are not referenced in the index anymore. 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 re-initialized.
WinDev, WinDev Mobile and WebDev propose an automatic management of errors for the following types of errors: Duplicate error, integrity error, password error, modification conflict error and status error during modification conflict, lock error. See Assisted management of HFSQL errors for more details.

Note: From version 19, HFSQL is the new name of HyperFileSQL.
Example
// Clears the file without re-creating it
HDeleteAll(Customer)

Syntax
<Result> = HDeleteAll(<File Name>)
<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.
<File Name>: Character string (with or without quotes)
Name of the HFSQL data file, HFSQL view or query used.

Remarks

Deleting records from a query

If the query was created by using the hModifyFile constant, HDeleteAll deletes the records from the source of the query.

Deleting records from a HFSQL view

HDeleteAll 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

HDeleteAll does not delete the records found in a transaction (canceled or validated).

Benefit compared to a loop for deleting records

To delete the records from a data file, you also have the ability to perform a loop for deleting records (HDelete). For example:

FOR EACH CustNum OF Orders
        HDelete()
END

Using HDeleteAll presents the following benefits:
  • the process is faster
  • the size of the empty data file is smaller.

Benefits compared to the use of HCreation

To delete the records from a data file, you also have the ability to use HCreation.

Using HDeleteAll presents the following benefits:

  • Deletion possible even if users are connected to the data file.
  • Automatic management of HFSQL errors.

Components
Reports and Queries wd190hf.dll
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment