NAME
dbquery - get ancillary information about a database
SYNOPSIS
#include "db.h"
int dbquery( Dbptr db, int code, void *value ) ;
DESCRIPTION
dbquery is the method for getting ancillary information (names, descriptions,
number of rows, columns, tables, etc) about a database.
Depending on the code, it may return an integer,
a pointer to a character string,
a pointer to a list (Tbl),
or a pointer to an associative array (Arr).
Note that the returned information is often pointers to parts of
Datascope's internal structures -- it should never be modified.
Please see the dbconstants(5) man page for an explanation of
all the possible values for code.
RETURN VALUES
dbquery returns 0 or a positive integer for success.
A negative value indicates some problem. A typical problem
might be requesting a field value (like dbFIELD_NAME) when
the input database pointer doesn't specify a field.
LIBRARY
$(DBLIBS)
DIAGNOSTICS
-
dbquery doesn't recognize code code
The input code was not recognized. The recognized codes are
all defined in the db.h include file.
SEE ALSO
dbconstants(5)
dbintro(3)
BUGS AND CAVEATS
The value dbquery returns for the code dbNULL is the exact string from the
schema; however, the string stored in a null record for that field can be
different, for fields which are not String, because the schema value is
first translated to the internal representation (eg, an integer) and
then converted back to a string according to the specified Attribute format.
The best way, therefore, to get the null value for a field is to
use
dbget(3) with the the null record.
AUTHOR
Daniel Quinlan