IBM Books

Data Movement Utilities Guide and Reference


Appendix D. Warning, Error, and Completion Messages

Messages generated by the various data movement utilities are included among the SQL messages. These messages are generated by the database manager when a warning or error condition has been detected. Each message has a message identifier that consists of a prefix (SQL) and a four- or five-digit message number. There are three message types: notification, warning, and critical. Message identifiers ending with an N are error messages. Those ending with a W indicate warning or informational messages. Message identifiers ending with a C indicate critical system errors.

The message number is also referred to as the SQLCODE. The SQLCODE is passed to the application as a positive or negative number, depending on its message type (N, W, or C). N and C yield negative values, whereas W yields a positive value. DB2 returns the SQLCODE to the application, and the application can get the message associated with the SQLCODE. DB2 also returns an SQLSTATE value for conditions that could be the result of an SQL statement. Some SQLCODE values have associated SQLSTATE values.

For detailed information about all of the DB2 messages, see the Message Reference. You can use the information contained in this book to identify an error or problem, and to resolve the problem by using the appropriate recovery action. This information can also be used to understand where messages are generated and logged.

SQL messages, and the message text associated with SQLSTATE values, are also accessible from the operating system command line. To access help for these error messages, enter the following at the operating system command prompt:

   db2 ? SQLnnnnn

where nnnnn represents the message number.

The message identifier accepted as a parameter for the db2 command is not case sensitive, and the terminating letter is not required. Therefore, the following commands will produce the same result:

   db2 ? SQL0000N
   db2 ? sql0000
   db2 ? SQL0000n

If the message text is too long for your screen, use the following command (on UNIX based operating systems and others that support the "more" pipe):

   db2 ? SQLnnnnn | more

You can also redirect the output to a file which can then be browsed.

Help can also be invoked from interactive input mode. To access this mode, enter the following at the operating system command prompt:

   db2

To get DB2 message help in this mode, type the following at the command prompt (db2 =>):

   ? SQLnnnnn

The message text associated with SQLSTATEs can be retrieved by issuing:

   db2 ? nnnnn
    or
   db2 ? nn

where nnnnn is a five-character SQLSTATE value (alphanumeric), and nn is a two-digit SQLSTATE class code (the first two digits of the SQLSTATE value).


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

[ DB2 List of Books | Search the DB2 Books ]