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

Retrieving Records with a Cursor

The DBcursor→c_get function is the standard interface for retrieving records from the database with a cursor. The DBcursor→c_get function takes a flag that controls how the cursor is positioned within the database, and returns the key/data item associated with that positioning. Similar to DB→get, DBcursor→c_get may also take a supplied key and retrieve the data associated with that key from the database. There are several flags that you can set to customize retrieval:

Cursor Position Flags

  • DB_FIRST, DB_LAST Return the first (last) record in the database.

  • DB_NEXT, DB_PREV Return the next (previous) record in the database.

  • DB_NEXT_DUP Return the next record in the database if it is a duplicate data item for the ...

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