1
<!--$Id: db_del.so,v 10.24 2001/06/19 20:07:15 bostic Exp $-->
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
6
<title>Berkeley DB: Db::del</title>
7
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
11
<a name="2"><!--meow--></a>
12
<table width="100%"><tr valign=top>
17
<a href="../api_cxx/cxx_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
22
#include <db_cxx.h>
25
Db::del(DbTxn *txnid, Dbt *key, u_int32_t flags);
28
<p>The Db::del method removes key/data pairs from the database. The
29
key/data pair associated with the specified <b>key</b> is discarded from
30
the database. In the presence of duplicate key values, all records
31
associated with the designated key will be discarded.
32
<p>When called on a database that has been made into a secondary index
33
using the <a href="../api_cxx/db_associate.html">Db::associate</a> method, the Db::del method deletes the
34
key/data pair from the primary database and all secondary indices.
35
<p>If the operation is to be transaction-protected, the <b>txnid</b>
36
parameter is a transaction handle returned from <a href="../api_cxx/txn_begin.html">DbEnv::txn_begin</a>;
38
<p>The <b>flags</b> parameter is currently unused, and must be set to 0.
39
<p>The Db::del method either returns a non-zero error value or throws an exception that
40
encapsulates a non-zero error value on failure, 0 on success, and <a href="../ref/program/errorret.html#DB_NOTFOUND">DB_NOTFOUND</a> if the specified <b>key</b> did not exist in
43
<p>The Db::del method may fail and throw an exception or return a non-zero error for the following conditions:
45
<p><dt>DB_LOCK_DEADLOCK<dd>The operation was selected to resolve a deadlock.
48
<p><dt>DB_SECONDARY_BAD<dd>A secondary index references a nonexistent primary key.
51
<p><dt>EACCES<dd>An attempt was made to modify a read-only database.
54
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
56
<p>The Db::del method may fail and throw an exception or return a non-zero error for errors specified for other Berkeley DB and C library or system methods.
57
If a catastrophic error has occurred, the Db::del method may fail and either
58
return <a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a> or throw an exception encapsulating
59
<a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a>, in which case all subsequent Berkeley DB calls will fail
62
<a href="../api_cxx/db_class.html">Db</a>
64
<a href="../api_cxx/db_associate.html">Db::associate</a>,
65
<a href="../api_cxx/db_close.html">Db::close</a>,
66
<a href="../api_cxx/db_cursor.html">Db::cursor</a>,
67
<a href="../api_cxx/db_del.html">Db::del</a>,
68
<a href="../api_cxx/db_err.html">Db::err</a>, <a href="../api_cxx/db_err.html">Db::errx</a>
69
<a href="../api_cxx/db_fd.html">Db::fd</a>,
70
<a href="../api_cxx/db_get.html">Db::get</a>,
71
<a href="../api_cxx/db_get.html">Db::pget</a>,
72
<a href="../api_cxx/db_get_byteswapped.html">Db::get_byteswapped</a>,
73
<a href="../api_cxx/db_get_type.html">Db::get_type</a>,
74
<a href="../api_cxx/db_join.html">Db::join</a>,
75
<a href="../api_cxx/db_key_range.html">Db::key_range</a>,
76
<a href="../api_cxx/db_open.html">Db::open</a>,
77
<a href="../api_cxx/db_put.html">Db::put</a>,
78
<a href="../api_cxx/db_remove.html">Db::remove</a>,
79
<a href="../api_cxx/db_rename.html">Db::rename</a>,
80
<a href="../api_cxx/db_set_alloc.html">Db::set_alloc</a>,
81
<a href="../api_cxx/db_set_append_recno.html">Db::set_append_recno</a>,
82
<a href="../api_cxx/db_set_bt_compare.html">Db::set_bt_compare</a>,
83
<a href="../api_cxx/db_set_bt_minkey.html">Db::set_bt_minkey</a>,
84
<a href="../api_cxx/db_set_bt_prefix.html">Db::set_bt_prefix</a>,
85
<a href="../api_cxx/db_set_cachesize.html">Db::set_cachesize</a>,
86
<a href="../api_cxx/db_set_dup_compare.html">Db::set_dup_compare</a>,
87
<a href="../api_cxx/db_set_errcall.html">Db::set_errcall</a>,
88
<a href="../api_cxx/db_set_errfile.html">Db::set_errfile</a>,
89
<a href="../api_cxx/db_set_errpfx.html">Db::set_errpfx</a>,
90
<a href="../api_cxx/db_set_feedback.html">Db::set_feedback</a>,
91
<a href="../api_cxx/db_set_flags.html">Db::set_flags</a>,
92
<a href="../api_cxx/db_set_h_ffactor.html">Db::set_h_ffactor</a>,
93
<a href="../api_cxx/db_set_h_hash.html">Db::set_h_hash</a>,
94
<a href="../api_cxx/db_set_h_nelem.html">Db::set_h_nelem</a>,
95
<a href="../api_cxx/db_set_lorder.html">Db::set_lorder</a>,
96
<a href="../api_cxx/db_set_pagesize.html">Db::set_pagesize</a>,
97
<a href="../api_cxx/db_set_paniccall.html">Db::set_paniccall</a>,
98
<a href="../api_cxx/db_set_q_extentsize.html">Db::set_q_extentsize</a>,
99
<a href="../api_cxx/db_set_re_delim.html">Db::set_re_delim</a>,
100
<a href="../api_cxx/db_set_re_len.html">Db::set_re_len</a>,
101
<a href="../api_cxx/db_set_re_pad.html">Db::set_re_pad</a>,
102
<a href="../api_cxx/db_set_re_source.html">Db::set_re_source</a>,
103
<a href="../api_cxx/db_stat.html">Db::stat</a>,
104
<a href="../api_cxx/db_sync.html">Db::sync</a>,
105
<a href="../api_cxx/db_truncate.html">Db::truncate</a>,
106
<a href="../api_cxx/db_upgrade.html">Db::upgrade</a>,
108
<a href="../api_cxx/db_verify.html">Db::verify</a>.
110
<table width="100%"><tr><td><br></td><td align=right>
111
<a href="../api_cxx/cxx_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
113
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>