### DB->set_errpfx

`

###

    #include <db.h>

    void
    DB->set_errpfx(DB *db, const char *errpfx);

    void DB->get_errpfx(DB *db, const char **errpfxp);

### Description: DB->set_errpfx

Set the prefix string that appears before error messages issued by Berkeley DB.

The DB->set_errpfx and DB_ENV->set_errpfx methods do not copy the memory to which the errpfx parameter refers; rather, they maintain a reference to it. Although this allows applications to modify the error 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_errpfx method affects the entire environment and is equivalent to calling the DB_ENV->set_errpfx method.

The DB->set_errpfx method configures operations performed using the specified DB handle, not all operations performed on the underlying database.

The DB->set_errpfx method may be called at any time during the life of the application.

### Parameters

errpfx
  The errpfx parameter is the application-specified error prefix for additional error messages.

### Description: DB->get_errpfx

The DB->get_errpfx method returns the error prefix.

The DB->get_errpfx method may be called at any time during the life of the application.

The DB->get_errpfx method returns a non-zero error value on failure and 0 on success.

### Parameters

errpfxp
  The DB->get_errpfx method returns a reference to the error prefix in errpfxp.

### Class

DB

### See Also

Databases and Related Methods`

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