It is not usually necessary to clear the DBT structures passed
to the Berkeley DB functions between calls. This is not always true, when
some of the less commonly used flags for DBT structures are
used. The DBT manual page specified the details of those cases.

It is possible, of course, to distinguish between system errors and the
key/data pair simply not existing in the database. There are three
standard returns from DB->get:

The call might be successful and the key found, in which case the return
value will be 0.

The call might be successful, but the key not found, in which case the
return value will be DB_NOTFOUND.

The call might not be successful, in which case the return value will
be a system error.