Application Building Guide

Appendix C. Problem Determination

You may 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 files
For build problems such as connecting to a database, precompiling, compiling, linking, and binding, you can use the build 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.

Application Development Guide
Refer to the Application Development Guide for syntax and other coding problems.

CLI Guide and Reference
Refer to the CLI Guide and Reference for syntax, the CLI Trace facility, configuration keywords, and coding problems related to CLI programs.

SQL Reference
Refer to the SQL Reference for syntax of SQL statements and functions.

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 Application Development Guide for more information.

Online error messages
Different components of DB2, including the database manager, database administration utility, installation and configuration process, and command line processor, generate online error messages. Each of these messages has a unique prefix and a four or five digit message number following the prefix. A single letter is displayed after the message number indicating the severity of the error.

You can use the command line processor to see the help for the message by entering:

db2 "? xxxnnnn"

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

For the full list and description of DB2 error messages, see the Message Reference.

Diagnostic tools and error log
These are provided 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 ]