SimpleDataset deleteRecord()
syntax: |
simpledataset.deleteRecord() |
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 the current record from the SimpleDataset and its associated database table. After deleting the record, the current record is set to the record "before" the first record.
|
see: |
#include <smdtset.jsh>, SimpleDataset deleteAll()
|
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 while( ds.next() ) ds.deleteRecord(); ds.close(); } |