)I#Berkeley DB: Db::del[P

Db::del





#include <db_cxx.h>

int1Db::del(DbTxn *txnid, Dbt *key, u_int32_t flags);





Description



<The Db::del method 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 fromQDbTxnMgr::begin, otherwise, NULL.

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

The Db::del>method either returns errno or throws an exception that:encapsulates an errno on failure, and 0 on success,Fand DB_NOTFOUND if the specified key did not exist in the file.



Errors

NIf a fatal error occurs in Berkeley DB, the Db::del method may fail and eitherIreturn DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY,Gat which point all subsequent database calls will also fail in the sameFway. Methods marked as returning errno will, by default, throwHan exception that encapsulates the error information. The default error\behavior can be changed, see DbException.

The Db::del&method may fail and throw an exceptionKfor any of the errors specified for the following Berkeley DB and C library functions:6Db::cursor,DBcursor->c_close(3),DBcursor->c_del(3),2Dbc::get,__account_page(3),dbenv->db_paniccall(3), fflush(3), fprintf(3),free(3),func(3),hcp->dbc->dbp->h_hash(3),>DbLockTab::get,8DbLock::put,>DbLockTab::vec,6DbLog::put, malloc(3), memcmp(3), memcpy(3), memmove(3),BDbMpoolFile::get,BDbMpoolFile::put,BDbMpoolFile::set, memset(3), realloc(3), strerror(3), vfprintf(3),and vsnprintf(3).

In addition, the Db::del&method may fail and throw an exceptionor 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.







Class

,Db



See Also

4Db::close,6Db::cursor,Db::del,.Db::fd,0Db::get,HDb::get_byteswapped,:Db::get_type,2Db::join,2Db::open,0Db::put,1Db::statand2Db::sync.
ÿÿ