D_DBGET(1)

NAME
d_dbget - get the id of the current database

SYNOPSIS
#include <typhoon.h>
d_dbget()

DESCRIPTION
When a database is opened it is assigned an internal id which it retains until it is closed. d_dbget gets the id of the current database. This id can be used in d_dbset(1) to make another open database the current database.

DIAGNOSTICS
The status code returned by the function is also stored in the global variable db_status.

S_OKAY
    Operation successful.

S_NOCD
    There is no current database.

CURRENCY CHANGES
None.

EXAMPLE
#include <typhoon.h>
int cust_dbid;
d_open("customer", "s");
d_dbget(&cust_dbid);
...
d_open(....);
...
/* Make the customer database the current database */
d_dbset(cust_dbid);

IDENTIFICATION
Author: Thomas B. Pedersen.
Copyright (c) 1994 Thomas B. Pedersen.

SEE ALSO
d_dbset(1)