delete



Summary

#include <dataman/dataman.h>

delete(idx_name);

char *idx_name;

Description This function deletes a database record from its database file. If the index's MFRP points to nothing, the diagnostic "Initial GET not attempted" is displayed, and the procedure exits. Otherwise the last accessed record is flushed to disk, and the record that the named index's MFRP points to is deleted from the database file. If the MFRP points to the last record in a data base file, the pointer is decremented to the previous record, otherwise the MFRP points to the record that followed the deleted record. If the user attempts to delete the only record in the database file, a diagnostic will result, and the program terminates. A call to delete will NOT remove all of the keys that point to the record. If a key is referenced that points to a deleted record, the key will be removed at that time. Otherwise only an explicit call to remove will do away with keys.

Example

#include <dataman/dataman.h>

    main(int argc, char *argv[])
    {


        key k_buff;
        char inpt[7];
          ...
        get(idx1,k_buff) else {
            pause(10,10,"Can't find key");
            exit(0);
        }
        delete(idx1);    /* delete the record */
    }

«previous  next»