IBM Books

Building Applications for UNIX** Environments


Appendix B. Problem Determination

You can encounter the following kinds of problems when building or running your applications:

You can use the following sources of information to resolve these problems:

Build script files
For build problems, such as connecting to a database, precompiling, compiling, linking, and binding, you can use the script files shown in this book to see command line processor commands and compiler options that work.

Compiler documentation
For compiler option problems not covered by the build script files.

Embedded SQL Programming Guide
Refer to the Embedded SQL Programming Guide for syntax and other coding problems.

CLI Guide and Reference
Refer to the CLI Guide and Reference for syntax and other coding problems related to CLI programs.

SQLCA data structure
If your application issues SQL statements or calls database manager APIs, it must check for error conditions by examining the SQLCA data structure.

The SQLCA data structure returns error information in the SQLCODE and SQLSTATE fields. The database manager updates the structure after every SQL statement is executed, and after most database manager API calls.

Your application can retrieve and print the error information or display it on the screen. Refer to the Embedded SQL Programming Guide for more information.

Online error messages
The database manager, database administration utility, installation and configuration process, and the command line processor generate online error messages. Each of these messages has a unique prefix as follows:

Prefix
Source

SQL
Database manager

DBA
Database Director

DBI
Installation and configuration

DB2
Command line processor

A four or five digit message number follows the prefix. A single letter follows the message number indicating the severity of the error.

You can use the command line processor to see the help for the message. Type:

db2 "? xxxnnnn"

where xxx is the message prefix, and nnnn is the message number. Include the quotes.

Refer to the Message Reference for more information about online error messages.

Diagnostic tools and error log
For build or runtime problems you cannot resolve using the other sources of information. The diagnostic tools include a trace facility, system log, and message log, among others. DB2 puts error and warning conditions in an error log based on priority and origin. Refer to the Troubleshooting Guide for more information. There is also a CLI trace facility specifically for debugging CLI programs. For more information, refer to the CLI Guide and Reference.


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

[ DB2 List of Books | Search the DB2 Books ]