DbDelete Function (Usual) | |
Mark the current record for deletion.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION DbDelete(
uArea AS USUAL
) AS LOGIC
public static bool DbDelete(
Usual uArea
)
Request Example
View SourceParameters
- uArea
- Type: Usual
Specifies the work area name or number for a table from which the value must be retrieved.
Return Value
Type:
Logic
TRUE if successful; otherwise, FALSE.
Remarks
Records marked for deletion can be filtered using SetDeleted() or removed from the file using DBPack().
By default, this function operates on the currently selected work area.
It can be made to operate on an unselected work area by specifying
it within an aliased expression
DBDelete() is the functional equivalent of the DELETE command with a scope of the current record.
For more information, refer to DELETE.
Tip |
---|
Logical records: If SetDeleted() is TRUE, deleted records are not logically visible. That is, database operations which operate on logical records will not consider records marked for deletion. Note, however, that if SetDeleted() is TRUE when the current record is marked for deletion, the record remains visible until it is no longer the current record.
Shared mode: For a shared database, DBDelete() requires the current record to be locked.
|
Examples
The following example deletes a record after a successful record lock:
1cLast := "Winston"
2DBUseArea(TRUE, "DBFNTX", "sales", "Sales", TRUE)
3Sales->DBSetIndex("LastName")
4IF Sales->DBSeek(cLast)
5 IF Sales->RLock()
6 Sales->DBDelete()
7 QOut("Record deleted: ", Sales->Deleted())
8 ELSE
9 QOut("Unable to lock record...")
10 ENDIF
11ELSE
12 QOut("Not found")
13ENDIF
See Also