Whenever you make a mistake typing in any of the examples or if an error occurs during execution of an SQL statement, the database manager returns an error message. The error message consists of a message identifier, a brief explanation, and an SQLSTATE.
SQLSTATEs are error codes common to the DB2 family of products. SQLSTATEs conform to the ISO/ANSI SQL92 standard.
For example, if the username or password had been incorrect in the CONNECT statement, the database manager would have returned a message identifier of SQL1403N and an SQLSTATE of 08004. The message is as follows:
SQL1403N The username and/or password supplied is incorrect. SQLSTATE=08004
You can get more information about the error message by typing a question mark (?) then the message identifier or the SQLSTATE:
? SQL1403N OR ? SQL1403 OR ? 08004
Note that the second last line in the description of the error SQL1403N states that the SQLCODE is -1403. SQLCODE is a produce specific error code. Message identifiers ending with N (Notification) or C (Critical) represent an error and have negative SQLCODEs. Message identifiers ending with W (Warning) represent a warning and have positive SQLCODEs.