Library Version 11.2.5.3

db truncate
Prev | Chapter 1. Berkeley DB Tcl APIs | Next

## db truncate

    db truncate
    	[-txn txnid]

Empties the database, discarding all records it contains.

The options are as follows:

- -txn txnid

  If the operation is part of an application-specified transaction, the txnid parameter is a transaction handle returned from env txn. If no transaction handle is specified, but the operation occurs in a transactional database, the operation will be implicitly transaction protected.

The db truncate command returns the number of records discarded from the database on success.

In the case of error, a Tcl error is thrown.

Prev | Up | Next
db sync | Home | dbc close