<< Click to Display Table of Contents >> Navigation: Apollo SQL > DDL & DML Statements > DELETE [WHERE] |
The DELETE statement is used to remove rows in tables.
Set the property Query.SetDeleted = True in order to hide the deleted records. Under xBase, deleted records are not deleted until the table is packed.
You must use the ExecSQL method to execute an DELETE statement. If you set Active to True or call Open with an DELETE statement in the SQL property, an error will be raised.
Syntax:
DELETE FROM table_reference [WHERE predicates]
Example:
DELETE FROM test WHERE (last = 'Smith') and (age = 90))
After issuing a DELETE command with ExecSQL, the result will not be immediately reflected in any previous result set. Re-issue a SELECT statement to retrieve the new result set.