IBM Books

DB2 Connect User's Guide


How CLI/ODBC Works

When an application program calls CLI/ODBC, the first thing that it must do is to make SQL calls to some of the system catalog tables on the target database in order to obtain information about other database contents. CLI/ODBC applications always access the system catalog tables in this way. There are ten API calls that may be made in order to gather information about the database that is being connected to. These API calls include:

   -   SQLTables
   -   SQLColumns
   -   SQLSpecialcolumns
   -   SQLStatistics
   -   SQLPrimarykeys
   -   SQLForeignkeys
   -   SQLTablePrivileges
   -   SQLColumnPrivileges
   -   SQLProcedures
   -   SQLProcedureColumns.

Further information about these API calls and the tables they reference is published in CLI Guide and Reference.

By default, when you connect to a database, your CLI/ODBC application will query the system catalog tables for information about ALL the database tables in that database. Especially on a large system this can result in a lot of network traffic and considerable delays when starting an application.


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

[ DB2 List of Books | Search the DB2 Books ]