|
|
|
|
|
- Handling a deleted record
- Number of deleted records
- Deleting a record from a query
- Version of data file
- Size of the data file
- Deletion and lock
- xBase/FoxFro
<Source>.Delete (Function) In french: <Source>.Supprime
Not available with this kind of connection
Deletes a record from a data file (query or view). The record is deleted logically and physically. It cannot be restored (unlike the records crossed by <Source>.Cross). The following operations are performed: - the record is deleted: the record is rendered inactive and is no longer referenced in the index. The data is not kept.
- the indexes (corresponding to the record keys) are deleted from the index file.
- the memos associated with the record are deleted from the memo file.
After running <Source>.Delete, the record is inserted in the list of deleted records and will be reused by <Source>.Add. 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.
Commande.LitRecherchePremier(NumCli, ValNumCli)
WHILE Commande.Trouve() = True
Commande.Supprime()
Commande.LitSuivant()
END
FOR EACH Commande where NumCli = ValNumCli
Commande.Supprime()
END
Syntax
<Result> = <Source>.Delete([<Record number> [, <Options>]])
<Result>: Boolean - True if the record was deleted,
- False if a problem occurred (locked record, etc. (see the special cases)). HErrorInfo is used to identify the error.
If the record to delete is already deleted, <Source>.Delete returns True.
<Source>: Type corresponding to the specified source Name of HFSQL data file or view used. <Record number>: Optional integer Number of the record to delete. If this parameter is not specified (if it is equal to 0 or to the hCurrentRecNum constant), the current record will be deleted. However, the current record will remain the deleted record. CAUTION: Do not confuse the Record number with the automation identifier associated with the Record.
In most cases, these two numbers are not identical. The record number is returned by <Source>.RecNum.
<Options>: Optional constant Configures the integrity management performed on the deleted record. Remarks Deleting a record from a query Deleting a record from a query can be performed: Regardless of how the query is executed (with or without the constant hWithFilterconstant), the <Source>.Delete function can only be used on single-file requests. Caution: - On non-HFSQL data files, there is no need to specify the constant hModifiesFile in functions <Source>.ExecuteQuery or <Source>.ExecuteSQLQuery: data files contributing to the query are automatically modified when the query result is modified.
- Records cannot be deleted from a query that uses groups or aggregates.
- Integrity and duplicates are not managed by operations on multi-file queries: it is advisable to use transactions to avoid any problems.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|