|
|
DBT: Bulk Retrieval |
If either of the DB_MULTIPLE or DB_MULTIPLE_KEY flags were specified to the DB->get or DBcursor->c_get methods, the data DBT returned by those interfaces will refer to a buffer that is filled with data. Access to that data is through the following macros:
DB_MULTIPLE_INIT(void *pointer, DBT *data);
Initialize the retrieval. The pointer parameter is a variable to be initialized. The data parameter is a DBT structure returned from a successful call to DB->get or DBcursor->c_get for which one of the DB_MULTIPLE or DB_MULTIPLE_KEY flags was specified.
DB_MULTIPLE_NEXT(void *pointer, DBT *data, void *retdata, size_t retdlen);
The data parameter is a DBT structure returned from a successful call to DB->get or DBcursor->c_get for which the DB_MULTIPLE flag was specified. The pointer and data parameters must have been previously initialized by a call to DB_MULTIPLE_INIT. The retdata parameter is set to refer to the next data element in the returned set, and the retdlen parameter is set to the length, in bytes, of that data element. When used with the Queue and Recno access methods, retdata will be set to NULL for deleted records. The pointer parameter is set to NULL if there are no more data elements in the returned set.
DB_MULTIPLE_KEY_NEXT(void *pointer, DBT *data, void *retkey, size_t retklen, void *retdata, size_t retdlen);
The data parameter is a DBT structure returned from a successful call to DBcursor->c_get for which the DB_MULTIPLE_KEY flag was specified. The pointer and data parameters must have been previously initialized by a call to DB_MULTIPLE_INIT. The retkey parameter is set to refer to the next key element in the returned set, and the retklen parameter is set to the length, in bytes, of that key element. The retdata parameter is set to refer to the next data element in the returned set, and the retdlen parameter is set to the length, in bytes, of that data element. The pointer parameter is set to NULL if there are no more key/data pairs in the returned set.
DB_MULTIPLE_RECNO_NEXT(void *pointer, DBT *data, db_recno_t recno, void * retdata, size_t retdlen);
The data parameter is a DBT structure returned from a successful call to DBcursor->c_get for which the DB_MULTIPLE_KEY flag was specified. The pointer and data parameters must have been previously initialized by a call to DB_MULTIPLE_INIT. The recno parameter is set to the record number of the next record in the returned set. The retdata parameter is set to refer to the next data element in the returned set, and the retdlen parameter is set to the length, in bytes, of that data element. When used with the Queue and Recno access methods, retdata will be set to NULL for deleted records. The pointer parameter is set to NULL if there are no more key/data pairs in the returned set.
Copyright (c) 1996-2005 Sleepycat Software, Inc. - All rights reserved.