)I#Berkeley DB: DB->del[P

DB->del





#include <db.h>

int:DB->del(DB *db, DB_TXN *txnid, DBT *key, u_int32_t flags);





Description



>The DB->del function removes key/data pairs from the database.GThe key/data pair associated with the specified key is discardedfrom the database.HIn 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 fromItxn_begin, otherwise, NULL.

EThe flags parameter is currently unused, and must be set to 0.

The DB->delDfunction returns the value of errno on failure, 0 on success,Fand DB_NOTFOUND if the specified key did not exist in the file.



Errors

PIf a fatal error occurs in Berkeley DB, the DB->del function may fail and returnFDB_RUNRECOVERY, at which point all subsequent database calls will alsoreturn DB_RUNRECOVERY.

The DB->del)function may fail and return errnoKfor any of the errors specified for the following Berkeley DB and C library functions:4DB->cursor,DBcursor->c_close(3),DBcursor->c_del(3),7DBcursor->c_get,__account_page(3),dbenv->db_paniccall(3), fflush(3), fprintf(3),free(3),func(3),hcp->dbc->dbp->h_hash(3),6lock_get,3lock_put,6lock_vec,1log_put, malloc(3), memcmp(3), memcpy(3), memmove(3),9memp_fget,9memp_fput,9memp_fset, memset(3), realloc(3), strerror(3), vfprintf(3),and vsnprintf(3).

In addition, the DB->del)function may fail and return errnofor the following conditions:

D

EACCES
An attempt was made to modify a read-only database.


B

EINVAL
An invalid flag value or parameter was specified.







See Also

8db_appexit,8db_appinit,8db_version,2DB->close,4DB->cursor,DB->del,,DB->fd,.DB->get,0DB->join,/db_open,.DB->put,0DB->stat,0DB->sync,;DBcursor->c_close,7DBcursor->c_del,6DBcursor->c_getand7DBcursor->c_put.
ÿÿ