IBM Books

Call Level Interface Guide and Reference

Querying Environment and Data Source Information

There are many situations when an application requires information about the characteristics and capabilities of the current DB2 CLI driver or the data source that it is connected to.

One of the most common situations involves displaying information for the user. Information such as the data source name and version, or the version of the DB2 CLI driver might be displayed at connect time, or as part of the error reporting process.

These functions are also useful to generic applications that are written to adapt and take advantage of facilities that may be available from some, but not all database servers.

The following DB2 CLI functions provide data source specific information:

Querying Environment Information Example

The getinfo.c sample, shown in Example generates the following output when connected to DB2.

       Server Name: SAMPLE
     Database Name: SAMPLE
     Instance Name: db2inst1
         DBMS Name: DB2/6000
      DBMS Version: 05.00.0000
    CLI Driver Name: libdb2.a
 CLI Driver Version: 05.00.0000
 ODBC SQL Conformance Level: Extended Grammar


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

[ DB2 List of Books | Search the DB2 Books ]