Saturday, July 3, 2010

DB2 Error codes

One of the things that make working with IBM DB2 hard, are the very useful(read: useless) errorcodes you get back. No other information is returned so you don’t have a clue what’s going on.

To find the corresponding error message, you have two options:

  1. Browse to the IBM site and search for the error. For people who have already tried finding their way in this site, it’s very easy to get lost.
  2. Search for the error message using the DB2 tools.

Let’s have a look at the second option:

  • Open a DB2 command window
  • Execute "db2 ? [errorcode]"

One sample. When the Error Code was SQL0668N than execute:

   1:  db2 ? SQL0668N


This will return a list of reason codes and their explanation.

No comments: