IBM Books

Administrative API Reference

sqlfxdb - Get Database Configuration

Returns the values of individual entries in a database configuration file.

For a brief description of the database configuration parameters, see the Command Reference. For detailed information about these parameters, see the Administration Guide.

Scope

This API returns information only for the node from which it is called.

Authorization

None

Required Connection

Instance. It is not necessary to call ATTACH before getting the configuration of a remote database. If the database is cataloged as remote, an instance attachment to the remote node is established for the duration of the call.

Version

sqlutil.h

C API Syntax



/* File: sqlutil.h */
/* API: Get Database Configuration */
/* ... */
SQL_API_RC SQL_API_FN
  sqlfxdb (
    _SQLOLDCHAR * pDbAlias,
    unsigned short NumItems,
    struct sqlfupd * pItemList,
    struct sqlca * pSqlca);
/* ... */
 

Generic API Syntax



/* File: sqlutil.h */
/* API: Get Database Configuration */
/* ... */
SQL_API_RC SQL_API_FN
  sqlgxdb (
    unsigned short DbAliasLen,
    unsigned short NumItems,
    struct sqlfupd * pItemList,
    struct sqlca * pSqlca,
    char * pDbAlias);
/* ... */
 

API Parameters

DbAliasLen
Input. A 2-byte unsigned integer representing the length in bytes of the database alias.

NumItems
Input. Number of entries to be returned. The minimum valid value is 1.

pItemList
Input/Output. Pointer to an array of NumItem sqlfupd structures, each containing a token field indicating which value to return, and a pointer field indicating where to place the configuration value. For more information about this structure, see SQLFUPD.

pSqlca
Output. A pointer to the sqlca structure. For more information about this structure, see SQLCA.

pDbAlias
Input. A string containing the database alias.

REXX API Syntax



GET DATABASE CONFIGURATION FOR database_alias USING :values 

REXX API Parameters

database_alias
Alias of the database associated with a specific database configuration file.

values
A compound REXX host variable containing tokens that indicate the configuration fields to be returned. The application provides the token and the API returns the value. The following are elements of a variable, where XXX represents the host variable name:

XXX.0
Twice the number of fields returned (number of data elements in the remainder of the variable)

XXX.1
First token

XXX.2
Value returned for the first field

XXX.3
Second token

XXX.4
Value returned for the second field

XXX.5
and so on.

Sample Programs

C
\sqllib\samples\c\dbconf.c

COBOL
\sqllib\samples\cobol\dbconf.cbl

FORTRAN
\sqllib\samples\fortran\dbconf.f

REXX
\sqllib\samples\rexx\dbconf.cmd

Usage Notes

Entries in the database configuration file that are not listed in the token values for pItemList are not accessible to the application.

The application is responsible for allocating sufficient memory for each data element returned. For example, the value returned for newlogpath can be up to 242 bytes in length.

If an error occurs, the information returned is not valid. If the configuration file is invalid, an error message is returned. The database must be restored from a backup version.

To set the database configuration parameters to the database manager defaults, use sqlfrdb - Reset Database Configuration.

For more information about these parameters, see the Administration Guide.

See Also

sqlfddb - Get Database Configuration Defaults

sqlfrdb - Reset Database Configuration

sqlfudb - Update Database Configuration.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]