SimpleDataset deleteAll()
syntax: |
simpledataset.deleteAll() |
return: |
boolean - value indicating success. In the case that the operation failed, use the getLastErrorCode() and getLastError() methods to determine the reason for the failure.
|
description: |
This method removes all records from the SimpleDataset. The corresponding rows will also be deleted from the associated database table.
|
see: |
#include <smdtset.jsh>, SimpleDataset deleteRecord()
|
example: |
// This function will delete all records // with USA as their country function delete_USA(db, table, user, passwd) { var ds = new SimpleDataset(db, table, user, passwd );
// find the entries whose country is USA var template; template.country = "USA"; ds.find(template);
// delete the records from the SimpleDataset // and clean up ds.deleteAll(); ds.close(); } |