URL: http://www.firstbasesoftware.com/man/man3/getrec.htm
Last modified: 4 April 1996
Copyright © by FirstBase Software.
[ Index of Contents] [ FirstBase RDBMS Overview]


NAME

getrec

SYNOPSIS

#include <firstbase/fb.h>

fb_getrec(rec, db)
long rec;
fb_database *db;

DESCRIPTION

As explained in the database(4) manual page, a database structure contains all of the elements needed for an entire database, including an array of field structures, all file names and descriptors, and index information. Altogether, the array of field structures can hold one complete record.

Fb_getrec retrieves logical record rec from the database pointed to by db and initializes the array of field structures. The map file descriptor stored in db->mfd is used to determine the location and length of the record in the database. The database file descriptor, stored in db->fd, is used to read the indicated record.

As mentioned, fb_getrec sets up all of the database field descriptors so each individual field is readily available. Each field is accessed through an array of field descriptors, or key pointers. The base of this array is located in the database structure variable db->kp.

A macro function, FB_FLD(n, db) can be used to access field number n of database db, or use fetch(3).

CLIENT/SERVER

The fb_getrec routine will transparently call the fb_getrec_clnt mechanism when the global FirstBase variable cdb_use_rpc is set to one. See fb_clnt_create(3) for more details.

SEE ALSO

fetch(3), putrec(3), getirec(3), getxrec(3), opendb(3), database(4).

DIAGNOSTICS

Fb_getrec will return the error code FB_ERROR if any of its reads, writes, or seeks fail. On correct completion, the number of characters read will be returned.

Note: getrec will lock record 0 to gain exclusive access to the database only if the LOCKLEVEL is 2 or more. See setup(5).


URL: http://www.firstbasesoftware.com/man/man3/getrec.htm
Last modified: 4 April 1996
Copyright © by FirstBase Software.
[ Index of Contents] [ FirstBase RDBMS Overview]