Using the cmdDelete object and its associated methods you can delete records from a data table.
Constructor
[new] cmdDelete
(tablename) |
Constructs and returns a new cmdDelete object. The tablename argument designates the table from which records are to be deleted. The tablename argument must be quote enclosed. |
|
Instance Methods
execute |
Deletes from a data table, as specified by the cmdDelete object's filter settings. |
getFilter |
Returns the cmdDelete object's filter, as set by the setFilter() method. |
getTablename |
Returns the name of the table specified in the cmdDelete constructor. |
setFilter |
Sets the filter for the cmdDelete object. |
|
Example
The following example deletes records from the AddressBook table.
//Creates a new cmdDelete object and identifies the table,
//"AddressBook", from which records are to be deleted.
var del = new cmdDelete("AddressBook");
//Identifies what sort of records are to be deleted.
//In this case, all records where the "LastName" field
//has the value "Smith" are to be deleted.
del.setFilter("LastName = 'Smith'");
//Actually deletes records from the "AddressBook" data table.
del.execute();
var del = new cmdDelete("AddressBook");
del.setFilter("LastName = 'Smith'");
del.execute();