#include <db.h>int DB->del(DB *db, DB_TXN *txnid, DBT *key, u_int32_t flags);
The DB->del function removes key/data pairs from the database. The key/data pair associated with the specified key is discarded from the database. In the presence of duplicate key values, all records associated with the designated key will be discarded.
If the file is being accessed under transaction protection, the txnid parameter is a transaction ID returned from txn_begin, otherwise, NULL.
The flags parameter is currently unused, and must be set to 0.
The DB->del function returns the value of errno on failure, 0 on success, and DB_NOTFOUND if the specified key did not exist in the file.
The DB->del function may fail and return errno for any of the errors specified for the following Berkeley DB and C library functions: DB->cursor, DBcursor->c_close(3), DBcursor->c_del(3), DBcursor->c_get, __account_page(3), dbenv->db_paniccall(3), fflush(3), fprintf(3), free(3), func(3), hcp->dbc->dbp->h_hash(3), lock_get, lock_put, lock_vec, log_put, malloc(3), memcmp(3), memcpy(3), memmove(3), memp_fget, memp_fput, memp_fset, memset(3), realloc(3), strerror(3), vfprintf(3), and vsnprintf(3).
In addition, the DB->del function may fail and return errno for the following conditions: