1
<!--$Id: dbc_del.so,v 10.26 2001/07/09 14:20:16 bostic Exp $-->
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
6
<title>Berkeley DB: Dbc.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_java/java_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
22
import com.sleepycat.db.*;
24
public int del(int flags)
28
<p>The Dbc.del method deletes the key/data pair to which the cursor
30
<p>When called on a cursor opened on a database that has been made into a
31
secondary index using the <a href="../api_java/db_associate.html">Db.associate</a> method, the <a href="../api_java/db_del.html">Db.del</a> method
32
deletes the key/data pair from the primary database and all secondary
34
<p>The <b>flags</b> parameter is currently unused, and must be set to 0.
35
<p>The cursor position is unchanged after a delete, and subsequent calls to
36
cursor functions expecting the cursor to refer to an existing key will
38
<p>If the element has already been deleted, Dbc.del will return
39
<a href="../ref/program/errorret.html#DB_KEYEMPTY">Db.DB_KEYEMPTY</a>.
40
<p>If the cursor is not yet initialized, the Dbc.del method throws an exception that encapsulates EINVAL.
41
<p>Otherwise, the Dbc.del method throws an exception that encapsulates a non-zero error value on
44
<p>The Dbc.del method may fail and throw an exception encapsulating a non-zero error for the following conditions:
46
<p><dt>Db.DB_SECONDARY_BAD<dd>A secondary index references a nonexistent primary key.
49
<p><dt>EACCES<dd>An attempt was made to modify a read-only database.
52
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
55
<p><dt>EPERM <dd>Write attempted on read-only cursor when the <a href="../api_java/env_open.html#DB_INIT_CDB">Db.DB_INIT_CDB</a> flag was
56
specified to <a href="../api_java/env_open.html">DbEnv.open</a>.
58
<p>If the operation was selected to resolve a deadlock, the
59
Dbc.del method will fail and
60
throw a <a href="../api_java/deadlock_class.html">DbDeadlockException</a> exception.
61
<p>The Dbc.del method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods.
62
If a catastrophic error has occurred, the Dbc.del method may fail and throw
63
a <a href="../api_java/runrec_class.html">DbRunRecoveryException</a>, in which case all subsequent Berkeley DB calls
64
will fail in the same way.
66
<a href="../api_java/dbc_class.html">Dbc</a>
68
<a href="../api_java/dbc_close.html">Dbc.close</a>,
69
<a href="../api_java/dbc_count.html">Dbc.count</a>,
70
<a href="../api_java/dbc_del.html">Dbc.del</a>,
71
<a href="../api_java/dbc_dup.html">Dbc.dup</a>,
72
<a href="../api_java/dbc_get.html">Dbc.get</a>,
73
<a href="../api_java/dbc_get.html">Dbc.pget</a>,
75
<a href="../api_java/dbc_put.html">Dbc.put</a>.
77
<table width="100%"><tr><td><br></td><td align=right>
78
<a href="../api_java/java_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
80
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>