Library Version 18.1.40

Db::set_msgpfx()
Prev | Chapter 2. The Db Handle | Next

## Db::set_msgpfx()

    #include <db_cxx.h>

    void Db::set_msgpfx(const char *msgpfx);

Set the prefix string that appears before informational messages issued by Berkeley DB. The length of this string can be no longer than 200.

The `Db::set_msgpfx()` and DbEnv::set_msgpfx() methods do not copy the memory to which the msgpfx parameter refers; rather, they maintain a reference to it. Although this allows applications to modify the informational message prefix at any time (without repeatedly calling the interfaces), it means the memory must be maintained until the handle is closed.

For Db handles opened inside of Berkeley DB environments, calling the `Db::set_msgpfx()` method affects the entire environment and is equivalent to calling the DbEnv::set_msgpfx() method.

The `Db::set_msgpfx()` method configures operations performed using the specified Db handle, not all operations performed on the underlying database.

The `Db::set_msgpfx()` method may be called at any time during the life of the application.

### Parameters

#### msgpfx

The msgpfx parameter is the application-specified informational prefix for additional informational messages.

### Class

Db

### See Also

Database and Related Methods

Prev | Up | Next
Db::set_msgfile() | Home | Db::set_pagesize()