Skip to Content
Berkeley DB
book

Berkeley DB

by Sleepycat™ Software, Inc.
June 2001
Intermediate to advanced content levelIntermediate to advanced
688 pages
19h 18m
English
Sams
Content preview from Berkeley DB

Partial Record Storage and Retrieval

It is possible to both store and retrieve parts of data items in all Berkeley DB access methods. This is done by setting the DB_DBT_PARTIAL flag in the DBT structure passed to the Berkeley DB interface.

The DB_DBT_PARTIAL flag is based on the values of two fields of the DBT structure: dlen and doff. The value of dlen is the number of bytes of the record in which the application is interested. The value of doff is the offset from the beginning of the data item where those bytes start.

For example, if the data item were ABCDEFGHIJKL, a doff value of 3 would indicate that the bytes of interest started at D, and a dlen value of 4 would indicate that the bytes of interest were DEFG.

When retrieving a data item ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Berkeley DB Book

The Berkeley DB Book

Himanshu Yadava
Linux Recipes for Oracle DBAs

Linux Recipes for Oracle DBAs

Darl Kuhn, Charles Kim, Bernard Lopuz
Fedora Linux

Fedora Linux

Chris Tyler

Publisher Resources

ISBN: 0735710643Purchase book