Returns the values of individual entries in a specific
database configuration file or a database manager configuration file.
Scope
Information about a specific database
configuration file is returned only for the database partition on
which it is executed.
Required connection
To obtain the current
online value of a configuration parameter for a specific database
configuration file, a connection to the database is required. To obtain
the current online value of a configuration parameter for the database
manager, an instance attachment is required. Otherwise, a connection
to a database or an attachment to an instance is not required.
API include file
db2ApiDf.h
API and data structure syntax
SQL_API_RC SQL_API_FN
db2CfgGet (
db2Uint32 versionNumber,
void * pParmStruct,
struct sqlca * pSqlca);
typedef SQL_STRUCTURE db2Cfg
{
db2Uint32 numItems;
struct db2CfgParam *paramArray;
db2Uint32 flags;
char *dbname;
} db2Cfg;
typedef SQL_STRUCTURE db2CfgParam
{
db2Uint32 token;
char *ptrvalue;
db2Uint32 flags;
} db2CfgParam;
SQL_API_RC SQL_API_FN
db2gCfgGet (
db2Uint32 versionNumber,
void * pParmStruct,
struct sqlca * pSqlca);
typedef SQL_STRUCTURE db2gCfg
{
db2Uint32 numItems;
struct db2gCfgParam *paramArray;
db2Uint32 flags;
db2Uint32 dbname_len;
char *dbname;
} db2gCfg;
typedef SQL_STRUCTURE db2gCfgParam
{
db2Uint32 token;
db2Uint32 ptrvalue_len;
char *ptrvalue;
db2Uint32 flags;
} db2gCfgParam;
db2CfgGet API parameters
- versionNumber
- Input. Specifies the version and release level of the structure
passed as the second parameter pParmStruct.
- pParmStruct
- Input. A pointer to the db2Cfg structure.
- pSqlca
- Output. A pointer to the sqlca structure.
db2Cfg data structure parameters
- numItems
- Input. The number of configuration parameters in the paramArray
array. Set this value to db2CfgMaxParam to specify the largest number
of elements in the paramArray.
- paramArray
- Input. A pointer to the db2CfgParam structure.
- flags
- Input. Specifies the type of action to be taken. Valid values
(defined in db2ApiDf header file, located in the include directory)
are:
- db2CfgDatabase
- Specifies to return the values in the database configuration file.
- db2CfgDatabaseManager
- Specifies to return the values in the database manager configuration
file.
- db2CfgImmediate
- Returns the current values of the configuration parameters stored
in memory.
- db2CfgDelayed
- Gets the values of the configuration parameters on disk. These
do not become the current values in memory until the next database
connection or instance attachment.
- db2CfgGetDefaults
- Returns the default values for the configuration parameter.
- dbname
- Input. The database name.
db2CfgParam data structure parameters
- token
- Input. The configuration parameter identifier.
Valid entries
and data types for the db2CfgParam token element are listed in "Configuration
parameters summary".
- ptrvalue
- Output. The configuration parameter value.
- flags
- Output. Provides specific information for each parameter in a
request. Valid values (defined in db2ApiDf header
file, located in the include directory) are:
- db2CfgParamAutomatic
- Indicates whether the retrieved parameter has a value of automatic.
To determine whether a given configuration parameter has been set
to automatic, perform a boolean AND operation against the value returned
by the flag and the db2CfgParamAutomatic keyword defined in db2ApiDf.h.
- db2CfgParamComputed
- Indicates whether the retrieved parameter has a value of computed.
To determine whether a given configuration parameter has been set
to computed, perform a boolean AND operation against the value returned
by the flag and the db2CfgParamComputed keyword defined in db2ApiDf.h.
If the boolean AND operation is false for both of
the keywords above, it means that the retrieved parameter value is
set manually.
db2gCfg data structure specific parameters
- dbname_len
- Input. The length in bytes of dbname parameter.
db2gCfgParam data structure specific parameters
- ptrvalue_len
- Input. The length in bytes of ptrvalue parameter.
Usage notes
The configuration parameters maxagents and maxcagents are
deprecated. In a future release, these configuration parameters may
be removed completely.
The db2CfgGet API will tolerate requests
for SQLF_KTN_MAXAGENTS and SQLF_KTN_MAXCAGENTS, but 0 will be returned
if the server is DB2® v9.5.