URL: http://www.firstbasesoftware.com/man/man3/fetch.htm
Last modified: 12 September 1995
Copyright © by FirstBase Software.
[
Index of Contents] [
FirstBase RDBMS Overview]
fb_fetch(f, s, db)
fb_field *f;
char *s;
fb_database *db;
These records are retrieved from the database file and stored into the field structures using getrec(3) or getxrec(3). Once a record has been loaded into the field structures of database db, fb_fetch can be used to copy a field from field descriptor f to a buffer s. This allows s to be walked on without fear of disturbing any data.
If the application program is not designed to run as a client for the FirstBase database server fbserver(8), then it is not always necessary to use fb_fetch since the field is readily available by accessing the char pointer fld in field descriptor f (f->fld).
A macro in the FirstBase header file called FB_FLD(n, db) will produce field n from database db as a char pointer (as long as the application is not based on client/server processing).
However, fb_fetch will also calculate and produce a formula (virtual) field in s. The FB_FLD macro will not accomplish this formula retrieval.
Also note that in the case of FB_BINARY fields, the entire field is ALWAYS fixed length. So, it is up to the programmer using fb_fetch(3) to make sure that s, the object being written into, is the same byte size as the field length in the database dictionary.