remove



Summary

#include <dataman/dataman.h>

remove(k_buff, idx_name) else ...

key k_buff;
char *idx_name;

Description

int db_rm_key(k_buff, idx_name)

This function removes a key from the specified index. The syntax for the original EDITOR command is:

    remove key from idx_name.

It does NOT delete the associated data record. The argument idx_name is the name of the index to operate on, and k_buff is a key type containing the key to be removed. The key must be constructed exactly as for the get procedure, using the mk_key function. If there are duplicate keys in the index, the function removes the first occurrence of the first matching key, unless a system KEY was used for the key argument. If the removed key is being pointed to by any index's KP, any subsequent get_next, or get_prior will issue a diagnostic and the process will terminate. If the index was saved, an attempt to restore it will generate an error as well. The get_current function would return false for this case.

Example

    #include <dataman/dataman.h>

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

        key k_buff;
          ...
        mk_key(k_buff,patient_no,strlen(patient_no));
        remove(number_ix,k_buff) else
            pause(10,10,"Patient number not on file");
          ...
    }

«previous  next»