db put

db put
	-append
	[-partial {doff dlen}]
	[-txn txnid]
	data

db put
	[-nooverwrite]
	[-partial {doff dlen}]
	[-txn txnid]
	key data  

The db put command stores the specified key/data pair into the database.

The options are as follows:

The db put command returns either 0 or a record number for success (the record number is returned if the -append option was specified). If an error occurs, a Berkeley DB error message is returned or a Tcl error is thrown.

If the underlying database is a Queue or Recno database, then the given key will be interpreted by Tcl as an integer. For all other database types, the key is interpreted by Tcl as a byte array.