DB->put API Ref

#include <db.h>

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


Description: DB->put

The DB->put method stores key/data pairs in the database. The default behavior of the DB->put function is to enter the new key/data pair, replacing any previously existing key if duplicates are disallowed, or adding a duplicate data item if duplicates are allowed. If the database supports duplicates, the DB->put method adds the new data value at the end of the duplicate set. If the database supports sorted duplicates, the new data value is inserted at the correct sorted location.

Unless otherwise specified, the DB->put method returns a non-zero error value on failure and 0 on success.

Parameters
flags data key txnid

Errors

The DB->put method may fail and return one of the following non-zero errors:


DB_LOCK_DEADLOCK DB_LOCK_NOTGRANTED

DB_REP_HANDLE_DEAD

DB_REP_LOCKOUT

EACCES

EINVAL

ENOSPC


Class DB
See Also Databases and Related Methods

APIRef

Copyright (c) 1996,2008 Oracle. All rights reserved.