# Berkeley DB: db truncate
Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++

db truncate |

`

    db truncate
    	[-txn txnid]

Description(db truncate)

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.

`

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